Multiple choice

What is the worst case run-time complexity of binary search algorithm?

  1. $Ο(n^2)$
  2. $O(log_2n)$
  3. $O(n logn)$
  4. $O(log logn)$
Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

Binary search repeatedly halves the search interval, resulting in a worst-case time complexity of $O(\log_2 n)$. Distractors like $O(n^2)$ and $O(n \log n)$ represent much slower, non-logarithmic algorithms, whereas $O(\log \log n)$ is too fast.