The average successful search time for sequential search on ‘n’ items is
2024
The average successful search time for sequential search on ‘n’ items is
- A.
n/2
- B.
(n-1) / 2
- C.
(n+1) / 2
- D.
log (n) + 1
Attempted by 90 students.
Show answer & explanation
Correct answer: C
Explanation:
If the search key matches the very first item, with one comparison we can terminate. If it is second, two comparisons, etc. So, average is (1+2+... +n)/n, i.e., (n+l)/2.