Skip to main contentSkip to solution

Find the condition that holds FALSE for binary search:

Solution

✅ Correct Option: 2

Binary search works only on a sorted list. It compares the key with the middle element and discards half of the list each time, which is valid only if the order of elements is known. Requiring an unordered list is therefore false.


Options 1, 3 and 4: all are true steps of binary search (sorted list, find the middle value, compare the middle element with the key).

Binary search takes O(log⁡n)O(\log n) time, while linear search works on unsorted lists but takes O(n)O(n) time.

Keyboard Shortcuts

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