Multiple choice

In the worst case, the number of comparisons needed to search a single linked list of length n for a given element is

  1. $\log n$
  2. $\dfrac{n}{2}$
  3. $\log_2 n -1$
  4. $n$
Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

Worst case of searching occurs when the element to be searched is at the end of the list so no. of comparisons required to search complete list would be n.