search
Log In
1 vote
4.7k views

The time required to search an element in a linked list of length n is

  1. $O(\log_2 n)$
  2. $O(n)$
  3. $O(1)$
  4. $O(n^2)$
in DS 4.7k views
0
Assuming we are talking about average case, clearly, option (B).

1 Answer

10 votes
 
Best answer

The time required to search an element in a linked list of length n is O(n).

In the worst case, the element to be searched has to be compared with all elements of linked list.

Option B is correct.


selected by
Answer:

Related questions

5 votes
3 answers
1
6.2k views
Which of the following operations is performed more efficiently by doubly linked list than by linear linked list? Deleting a node whose location is given Searching an unsorted list for a given item Inserting a node after the node with a given location Traversing the list to process each node
asked Jun 13, 2016 in DS jothee 6.2k views
2 votes
5 answers
2
4.2k views
The minimum number of fields with each node of doubly linked list is 1 2 3 4
asked Sep 20, 2015 in DS ajit 4.2k views
4 votes
1 answer
3
2.5k views
A complete binary tree with the property that the value at each node is at least as large as the values at its children is known as binary search tree AVL tree completely balanced tree Heap
asked Jun 13, 2016 in DS jothee 2.5k views
7 votes
1 answer
4
3.3k views
Stack A has the entries a, b, c (with a on top). Stack B is empty. An entry popped out of stack A can be printed immediately or pushed to stack B. An entry popped out of the stack B can be only be printed. In this arrangement, which of the following permutations of a, b, c are not possible? b a c b c a c a b a b c
asked Jun 13, 2016 in DS jothee 3.3k views
...