The average complexity of linear search and binary search are ___ and ____, respectively.
A. O(n)
B. O(n log n)
C. O(log n)
D. O(n*n)
The average complexity of linear search and binary search are ___ and ____, respectively.
A. O(n)
B. O(n log n)
C. O(log n)
D. O(n*n)
Solution
✅ Correct Option: 4
Linear search checks elements one by one, so on average it makes about comparisons, which is .
Binary search halves the sorted search range at every step, so it needs about comparisons, which is .
Options B and D: and are typical of sorting algorithms (merge sort and bubble sort respectively), not of searching a list.
Binary search works only on sorted data.
Related questions:
2026: 26 May Shift 1
2026: 18 May Shift 2
2026: 29 May Shift 1
2025: 21 May Shift 1
2025: 13 May Shift 2