Given the following list of elements:
2 3 5 7 10 11 12
Item to be searched = 2
Which of the following can be the middle of elements calculated by the binary search algorithm?
(A) 7
(B) 3
(C) 2
(D) 5
Given the following list of elements:
| 2 | 3 | 5 | 7 | 10 | 11 | 12 |
|---|
Item to be searched = 2
Which of the following can be the middle of elements calculated by the binary search algorithm?
(A) 7
(B) 3
(C) 2
(D) 5
Solution
✅ Correct Option: 2
Binary search takes (indices start at 0) and discards the half that cannot contain 2.
| Pass | low | high | mid | Element at mid | Decision |
|---|---|---|---|---|---|
| 1 | 0 | 6 | 3 | 7 | , so high becomes 2 |
| 2 | 0 | 2 | 1 | 3 | , so high becomes 0 |
| 3 | 0 | 0 | 0 | 2 | found |
The middle elements calculated are 7, 3 and 2, which are (A), (B) and (C).
(D) 5: it is at index 2, which is never the middle of any range used. The search moves left of index 3 and then left of index 1, so 5 is skipped.
Related questions:
2026: 23 May Shift 1
2026: 18 May Shift 2
2026: 29 May Shift 1
2026: 13 May Shift 2