Open In App
Related Articles

ISRO | ISRO CS 2008 | Question 70

Improve
Improve
Improve
Like Article
Like
Save Article
Save
Report issue
Report

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, so the time complexity is O(n). Option (B) is correct.



Quiz of this Question
Please comment below if you find anything wrong in the above post

Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out - check it out now!


Last Updated : 11 Jun, 2018
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads