Match List-I with List-II
Consider a sorted list comprising 15 elements:
numList = [2, 3, 5, 7, 10, 11, 12, 17, 19, 23, 29, 31, 37, 41, 43]
List-I List-II (A) Search for value 7 using linear search (I) Comparison=1 (B) Search for value 17 using binary search (II) Comparison=8 (C) Search for value 17 using linear search (III) Comparison=2 (D) Search for value 7 using binary search (IV) Comparison=4
Match List-I with List-II
Consider a sorted list comprising 15 elements:
numList = [2, 3, 5, 7, 10, 11, 12, 17, 19, 23, 29, 31, 37, 41, 43]
| List-I | List-II |
|---|---|
| (A) Search for value 7 using linear search | (I) Comparison=1 |
| (B) Search for value 17 using binary search | (II) Comparison=8 |
| (C) Search for value 17 using linear search | (III) Comparison=2 |
| (D) Search for value 7 using binary search | (IV) Comparison=4 |
Solution
✅ Correct Option: 1
| List I | List II |
|---|---|
| (A) Linear search for 7 | (IV) Comparison=4 |
| (B) Binary search for 17 | (I) Comparison=1 |
| (C) Linear search for 17 | (II) Comparison=8 |
| (D) Binary search for 7 | (III) Comparison=2 |
Linear search checks elements from the start, so the number of comparisons equals the position of the value (counting from 1). 7 is the 4th element and 17 is the 8th.
Binary search starts at the middle index , which holds 17, so 17 is found in 1 comparison. For 7, the first middle value 17 is too large, so the search narrows to indices 0 to 6. The new middle index is 3, which holds 7, so it takes 2 comparisons.
Related questions:
2025: 21 May Shift 1
2026: 23 May Shift 1
2026: 23 May Shift 2