Showing posts with label array. Show all posts
Showing posts with label array. Show all posts

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.