Skip to main contentSkip to solution

The best case of a binary search is when, ______________ .

Solution

✅ Correct Option: 3

Binary search first compares the key with the middle element. If the element is at the middle, it is found in the very first comparison, so the time taken is constant, O(1)O(1).


Option 1: first position is the best case for linear search, not binary search. Binary search needs several halvings to reach an end element.

Options 2 and 4: an element at an end or absent from the list needs about log⁡2n\log_2 n comparisons, which is the worst case.

Keyboard Shortcuts

  • Left arrow: Previous question
  • Right arrow: Next question
  • S key: Jump to solution
  • Q key: Jump to question