Friday, March 6, 2009

4. Position of a number in a sorted array

4. How many comparisons are required to find the position of a number in a sorted array.

Answer: Using binary search it would require O(log n) comparisons.

1 comment:

Varunkumar Nagarajan said...

Perfect!

Try solving these - http://varunkumar-n.blogspot.com/2009/03/solve-these.html