+1 vote
in Data Structures & Algorithms I by (110k points)
The worst case running time of a linear search on the self organizing list is ____

(a) O(1)

(b) O(logn)

(c) O(n)

(d) O(n^2)

This key question is from Types of Lists in section Types of Lists of Data Structures & Algorithms I

This question was addressed to me during an interview.

1 Answer

+1 vote
by (737k points)
selected by
Best answer
The correct answer is (c) O(n)

The best I can explain: Worst case occurs when the element is located at the very end of list. So n comparisons must be made to the locate element. So the worst case running time of linear search on self organizing list is O(n).

Related questions

Welcome to TalkJarvis QnA, a question-answer community website for the people by the people. On TalkJarvis QnA you can ask your doubts, curiosity, questions and whatever going in your mind either related to studies or others. Experts and people from different fields will answer.