## Find a duplicate element in a limited range array

Given a limited range array of size n where array contains elements between 1 to n-1 with one element repeating, find the duplicate number in it.

## Find index of 0 to be replaced to get maximum length sequence of continuous ones

Given a binary array, find the index of 0 to be replaced with 1 to get maximum length sequence of continuous ones.

## Print all sub-arrays with 0 sum

Given an array of integers, print all sub-arrays with 0 sum.

## Move all zeros present in the array to the end

Given an array of integers, move all zeros present in the array to the end. The solution should maintain the relative order of items in the array.

## Find majority element in an array (Boyer–Moore majority vote algorithm)

Given an array of integers containing duplicates, return the majority element in an array if present. A majority element appears more than n/2 times where n is the size of the array.

## Find Equilibrium Index of an Array

Given an array of integers, find equilibrium index in it.

## Find Pair with given Sum in the Array

Given an unsorted array of integers, find a pair with given sum in it.

## Sort an array containing 0’s, 1’s and 2’s (Dutch national flag problem)

Given an array containing only 0’s, 1’s and 2’s, sort the array in linear time and using constant space.

## Rearrange the array with alternate high and low elements

Given an array of integers, rearrange the array such that every second element of the array is greater than its left and right elements. Assume no duplicate elements are present in the array.

## Find Lowest Common Ancestor (LCA) of two nodes in a BST

Given a BST and two nodes x and y in it, find lowest common ancestor (LCA) of x and y in it.

## Determine if given Binary Tree is a BST or not

Given a Binary Tree, determine if it is a BST or not.   This problem has a simple recursive solution. The BST property “every node on the right subtree has to be larger than the current node and every node on the left subtree has to be smaller than the current node” is the key …

## Construct balanced BST from given keys

Given an unsorted array of integers which represents binary search tree keys, construct a height balanced BST from it.