GATE Computer Science
What is the time complexity of binary search on a sorted array of n items?
Correct answer: C. O(log n)
Each step halves the search range, so about log2 n steps are needed.
Each step halves the search range, so about log2 n steps are needed.