##
Move all zeroes to end of array
October 12, 2013

Given an array of random numbers, Push all the zero’s of a given array to the end of the array.

October 12, 2013

Given an array of random numbers, Push all the zero’s of a given array to the end of the array.

June 24, 2013

Given a sequence of non-negative integers, find the subsequence of length 3 having maximum product with the numbers of the subsequence being in ascending order.

April 13, 2013

An array contains both positive and negative numbers in random order. Rearrange the array elements so that positive and negative numbers are placed alternatively.

March 31, 2013

The cost of a stock on each day is given in an array, find the max profit that you can make by buying and selling in those days.

March 26, 2013

Given an array of size n, the array contains numbers in range from 0 to k-1 where k is a positive integer and k < = n. Find the maximum repeating number in this array.

March 21, 2013

Given a set of time intervals in any order, merge all overlapping intervals into one and output the result which should have only mutually exclusive intervals. Let the intervals be represented as pairs of integers for simplicity.

February 19, 2013

Given an array of numbers, arrange them in a way that yields the largest value. For example, if the given numbers are {54, 546, 548, 60}, the arrangement 6054854654 gives the largest value.

November 23, 2012

In my previous post, I have explained about longest increasing sub-sequence (LIS) problem in detail.

October 11, 2012

Given an unsorted array of positive integers. Find the number of triangles that can be formed with three different array elements as three sides of triangles. For a triangle to be possible from 3 values, the sum of any two values (or sides) must be greater than the third value (or third side).

September 18, 2012

Given n numbers (both +ve and -ve), arranged in a circle, fnd the maximum sum of consecutive number.

September 4, 2012

Given an array of integers, find all combination of four elements in the array whose sum is equal to a given value X.