# Category Archives: Algorithms

## Print all shortest paths between given source and destination in an undirected graph

Given an undirected and unweighted graph and two nodes as source and destination, the task is to print all the paths of the shortest length… Read More »

## Count of subsequences of length 4 in form (x, x, x+1, x+1) | Set 2

Given a large number in form of string str of size N, the task is to count the subsequence of length 4 whose digit are… Read More »

## Count number of ways to convert string S to T by performing K cyclic shifts

Given two strings S and T and a number K, the task is to count the number of ways to convert string S to string… Read More »

## Frequency of maximum occurring subsequence in given string

Given a string str of lowercase English alphabets, our task is to find the frequency of occurrence a subsequence of the string which occurs the… Read More »

## Find the missing number in unordered Arithmetic Progression

Given an unsorted array arr[] of N integers that are in Arithmetic Progression, the task is to print the missing element from the given series.… Read More »

## Largest substring where all characters appear at least K times | Set 2

Given a string str and an integer K, the task is to find the length of the longest sub-string S such that every character in… Read More »

## Construct the Array using given bitwise AND, OR and XOR

Given Bitwise AND, OR, and XOR of N elements of an array denoted by a, b, c. The task is to find the elements of… Read More »

## Minimum number of adjacent swaps required to convert a permutation to another permutation by given condition

Given a permutation P of size N, having values from 1 to N. the task is to find the minimum number of adjacent swaps required… Read More »

## Count of anagrams of each string in an array present in another array

Given two arrays arr1[] and arr2[] consisting of strings, the task is to print the count of anagrams of every string in arr2[] that are… Read More »

## Find the equation of plane which passes through two points and parallel to a given axis

Given two points A(x1, y1, z1) and B(x2, y2, z2) and a set of points (a, b, c) which represent the axis (ai + bj… Read More »

## Count of all possible reverse bitonic subarrays

Given an array arr[] of N integers, the task is to count the total number of Reverse Bitonic Subarray from the given array. A Reverse… Read More »

## Find all powers of 2 less than or equal to a given number

Given a positive number N, the task is to find out all the perfect powers of two which are less than or equal to the… Read More »

## Find duplicates in an Array with values 1 to N using counting sort

Given a constant array of N elements which contain elements from 1 to N – 1, with any of these numbers appearing any number of… Read More »

## Number of cycles formed by joining vertices of n sided polygon at the center

Given an N-sided regular polygon, we have connected all the vertices at the center of the polygon, thus dividing the polygon into N equal parts.… Read More »

## Find the next greater element in a Circular Array

Given a circular array arr[] of N integers such that the last element of the given array is adjacent to the first element of the… Read More »