##
Circle Sort
October 10, 2017

Circle sort algorithm can be visualized by drawing concentric circles on an array of integers. The elements of the array lying on the same circle… Read More »

October 10, 2017

Circle sort algorithm can be visualized by drawing concentric circles on an array of integers. The elements of the array lying on the same circle… Read More »

A Happy Number n is defined by the following process. Starting with n, replace it with the sum of the squares of its digits, and… Read More »

Express a given number as a summation of 4 positive primes. If it is not possible to express then print “-1”. Examples: Input: 24 Output:… Read More »

Given N lines in two-dimensional space in y = mx + b form and a vertical section. We need to find out whether there is… Read More »

iven a string, print the longest repeating subseequence such that the two subsequence don’t have same string character at same position, i.e., any i’th character… Read More »

October 9, 2017

Given two values ‘a’ and ‘n’, find sum of series a^1/1! + a^2/2! + a^3/3! + a^4/4! +…….+ a^n/n!. Input : a = 2 and… Read More »

A tree with N nodes and N-1 edges is given with 2 different colours for its nodes. Find the sub-tree with minimum colour difference i.e.… Read More »

Given an array of size n that has the following specifications: Each element in the array contains either a policeman or a thief. Each policeman… Read More »

Given a positive integer n(1 <= n <= 1018). Check whether a number has exactly three distinct factors or not. Print “Yes” if it has… Read More »

Given an integer n, print m increasing numbers such that the sum of m numbers is equal to n and the GCD of m numbers… Read More »

Given a set of characters generate all possible passwords from them. This means we should generate all possible permutations of words using the given characters,… Read More »

October 8, 2017

Given a natural number n, find the number of ways in which n can be expressed as a sum of natural numbers when order is… Read More »

Given an array of n integers, we need to find the no. of ways of choosing pairs with maximum difference. Examples: Input : a[] =… Read More »

Given an array containing only 0s and 1s. For each index ‘i‘(0 index), find length of the longest alternating sub-array starting from ‘i‘ to ‘j‘… Read More »

You are given a lock which is made up of n-different circular rings and each ring has 0-9 digit printed serially on it. Initially all… Read More »