Question DSA-SRCH-0080
HardWhy does linear search on a linked list of sorted values not become O(log n)?
- A.
Binary search needs hashing
- B.
Linked lists can't be sorted
- C.
Sign up free to see the answer and a step-by-step explanation.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Searching and Binary Search question
Why does linear search on a linked list of sorted values not become O(log n)?
Binary search needs hashing
Linked lists can't be sorted
Sign up free to see the answer and a step-by-step explanation.
It does become O(log n)
Reaching the middle node needs O(n) steps, since there is no random access