Consider the sorted list of 15 elements:-
list = [2, 3, 5, 7, 10, 11, 12, 17, 19, 23, 29, 31, 37, 41, 43]
We need to search for element 2 in this list. What will be the order of the elements found at MID position in the first four iterations of binary search?
(A) 2
(B) 3
(C) 17
(D) 7
Consider the sorted list of 15 elements:-
list = [2, 3, 5, 7, 10, 11, 12, 17, 19, 23, 29, 31, 37, 41, 43]
We need to search for element 2 in this list. What will be the order of the elements found at MID position in the first four iterations of binary search?
(A) 2
(B) 3
(C) 17
(D) 7
Solution
✅ Correct Option: 4
Binary search uses with indices 0 to 14. Since the target 2 is smaller than the middle element, the search keeps moving to the left half by setting .
| Iteration | low | high | mid | Element at mid | Comparison with 2 |
|---|---|---|---|---|---|
| 1 | 0 | 14 | 7 | 17 (C) | 2 < 17, go left |
| 2 | 0 | 6 | 3 | 7 (D) | 2 < 7, go left |
| 3 | 0 | 2 | 1 | 3 (B) | 2 < 3, go left |
| 4 | 0 | 0 | 0 | 2 (A) | found |
The order of mid elements is 17, 7, 3, 2, which is (C), (D), (B), (A).
Related questions:
2026: 23 May Shift 1
2026: 11 May Shift 2
2026: 29 May Shift 2
2026: 18 May Shift 2
2026: 26 May Shift 1