##
Find the minimum element in a sorted and rotated array
July 2, 2013

A sorted array is rotated at some unknown point, find the minimum element in it. Following solution assumes that all elements are distinct.

July 2, 2013

A sorted array is rotated at some unknown point, find the minimum element in it. Following solution assumes that all elements are distinct.

June 19, 2013

Given a function ‘int f(unsigned int x)’ which takes a non-negative integer ‘x’ as input and returns an integer as output.

May 18, 2013

Given an array of integers. Find a peak element in it. An array element is peak if it is NOT smaller than its neighbors. For corner elements, we need to consider only one neighbor.

April 18, 2013

Given two binary strings that represent value of two integers, find the product of two strings. For example, if the first bit string is “1100” and second bit string is “1010”, output should be 120.

April 8, 2013

Find the largest rectangular area possible in a given histogram where the largest rectangle can be made of a number of contiguous bars. For simplicity, assume that all bars have same width and the width is 1 unit.

March 16, 2013

You are given a one dimensional array that may contain both positive and negative integers, find the sum of contiguous subarray of numbers which has the largest sum.

November 28, 2012

We are given an array of n points in the plane, and the problem is to find out the closest pair of points in the array. This problem arises in a number of applications.

November 15, 2012

Like Greedy and Dynamic Programming, Divide and Conquer is an algorithmic paradigm. A typical Divide and Conquer algorithm solves a problem using following three steps.

September 28, 2012

This is an extension of median of two sorted arrays of equal size problem. Here we handle arrays of unequal size also.

January 14, 2012

Given an array of integers which is initially increasing and then decreasing, find the maximum value in the array.

December 1, 2011

Given an array of n distinct integers sorted in ascending order, write a function that returns a Fixed Point in the array, if there is any Fixed Point present in array, else returns -1.