Bitkernel · Data Structures & Algorithms
Count binary search steps for specific keys
TrueInterview
October 7, 2026 · 1 min read
Consider the sorted array:
[22, 34, 55, 77, 89, 93, 99, 102, 120, 140]
Run standard binary search with low and high indices, using . How many comparisons are needed to find each of these keys: 77, 34, and 99?
State the result as a triple (comparisons for 77, comparisons for 34, comparisons for 99).
Options:
- A.
3, 3, 3 - B.
3, 3, 4 - C.
3, 4, 3 - D.
4, 2, 4
Overview: This item tests your grasp of binary search mechanics, your ability to count comparisons for a particular run, and your skill in algorithmic analysis and control-flow reasoning.
Loading comments…