Binary search invariant
Binary search on a sorted array of elements does how many comparisons in the worst case? (Each step halves the search range.)
Show hints (2)+
- Worst case is $\lceil \log_2(n+1) \rceil$.
- $n+1 = 64 = 2^6$.
Answer
Reveal answer →Final answer
6
Want the full step-by-step worked solution? It's part of Premium — along with a worked solution for every question in the bank.