Home » Programming & Data Structure » Programming and data structure miscellaneous » Question

Programming and data structure miscellaneous

Programming & Data Structure

  1. In the worst case, the number of comparisons needed to search a singly linked list of length n for a given element is
    1. log n
    2. n
      2

    3. log 2 (n - 1)
    4. n
Correct Option: D

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. Hence (d) is correct option.



Your comments will be displayed only after manual approval.