## Finding prime numbers

April 23, 2010

Output all prime numbers up to a specified integer n.

## Maximum Height (Depth) of a Binary Tree

April 21, 2010

Given a binary tree, find its maximum height.

## Binary Search Tree In-Order Traversal Iterative Solution

April 20, 2010

Given a binary search tree, print the elements in-order iteratively without using recursion.

## Multiplication of numbers

April 16, 2010

There is an array A[N] of N numbers. You have to compose an array Output[N] such that Output[i] will be equal to multiplication of all the elements of A[N] except A[i]. Solve it without division operator and in O(n). Read the rest of this entry →

## Hacking a Google interview (From MIT)

April 14, 2010

Google interview is so popular that even MIT dedicates a course to it!

## Rotating an array in place

April 13, 2010

Rotate a one-dimensional array of n elements to the right by k steps.
For instance, with n=7 and k=3, the array {a, b, c, d, e, f, g} is rotated to {e, f, g, a, b, c, d}.

## Searching an Element in a Rotated Sorted Array

April 13, 2010

Suppose a sorted array is rotated at some pivot unknown to you beforehand. (i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2). How do you find an element in the rotated array efficiently? You may assume no duplicate exists in the array.

## Finding all unique triplets that sums to zero

April 12, 2010

Given a set S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the set which gives the sum of zero. Read the rest of this entry →

## How to determine if a point is inside a rectangle?

April 12, 2010

Given a 2D point and a rectangle, determine if the point is inside the rectangle.

## Reversing linked list iteratively and recursively

April 12, 2010

Implement the reversal of a singly linked list iteratively and recursively.