For binary search, the list is in ascending order and the key is present in the list. If the middle element is less than the key, it means:
For binary search, the list is in ascending order and the key is present in the list. If the middle element is less than the key, it means:
Solution
Since the list is in ascending order, every element after the middle is greater than or equal to the middle element. If the middle element is less than the key, the key must lie after it, so the search continues in the second half (the lower bound moves to ).
Option 1: This would be true if the middle element were greater than the key, because then the key lies before the middle.
Option 4: The key equals the middle element only when the two are equal, not when the middle is less than the key.
Related questions:
2025: 16 May Shift 1
2025: 14 May Shift 1
2025: 27 May Shift 2
2026: 21 May Shift 1
2026: 11 May Shift 2