ISRO | ISRO CS 2008 | Question 68
The time required to search an element in a linked list of length n is
(A) O (log n)
(B) O (n)
(C) O (1)
(D) O(n2)
Answer: (B)
Explanation: In the worst case, the element to be searched has to be compared with all elements of linked list. It will take O(n) time to search the element.
So, option (B) is correct.
Quiz of this Question
Please Login to comment...