##
Stable Selection Sort
October 4, 2017

A sorting algorithm is said to be stable if two objects with equal or same keys appear in the same order in sorted output as… Read More »

October 4, 2017

A sorting algorithm is said to be stable if two objects with equal or same keys appear in the same order in sorted output as… Read More »

October 3, 2017

Given an array which contains all elements occurring k times, but one occurs only once. Find that unique element. Examples: Input : arr[] = {6,… Read More »

Generate all possible subset of size r of given array with distinct elements. Examples: Input : arr[] = {1, 2, 3, 4} r = 2… Read More »

Given an array where every element appears twice except a pair (two elements). Find the elements of this unique pair. Examples: Input : 6, 1,… Read More »

October 2, 2017

We are given N items which are of total K different colors. Items of the same color are indistinguishable and colors can be numbered from… Read More »

Given a number n, find the product of all factors of n. Since the product can be very large answer it modulo 10^9 + 7.… Read More »

The problem is to check whether the decimal representation of the given binary number is divisible by 10 or not. Take care, the number could… Read More »

Given a matrix of N rows and M columns. From m[i][j], we can move to m[i+1][j], if m[i+1][j] > m[i][j], or can move to m[i][j+1]… Read More »

Count the number of digits in a long integer entered by a user. Recommended: Please try your approach on {IDE} first, before moving on to… Read More »

October 1, 2017

Given a m x n matrix mat[][] containing positive integers. The problem is to reach to the cell (m-1, n-1) from the cell (0, 0)… Read More »

You are given an n-digit large number, you have to check whether it is divisible by 7. A (r+1)-digit integer n whose digital form is… Read More »

Given a matrix of size N X M consisting of ‘#’, ‘.’ and ‘*’. ‘#’ means blocked path, ‘.’ means walkable path and ‘*’ means… Read More »

September 30, 2017

Given a binary tree, we need to write a program to print all leaf nodes of the given binary tree from left to right. That… Read More »

Given a positive integer n. The problem is to check whether only the first and last bits are set in the binary representation of n.… Read More »

The tribonacci series is a generalization of the Fibonacci sequence where each term is the sum of the three preceding terms. The Tribonacci Sequence :… Read More »