First time here? Checkout the FAQ!
0 votes
Why linked list not suitable for binary search?
asked in DS by (25 points)   | 154 views

2 Answers

+2 votes
Best answer
There is no way to index the elements in the linked list which makes it unsuitable for binary search.
answered by Junior (625 points)  
selected by
We use binary search to reduce the search complexity to $O(\log n)$ but in a linked list to find the middle element itself takes $O(n)$.
+1 vote
Because nodes of linked list may or may not be present in the continuous memory location, so we can only use linear search while array occupies continuous memory location, so a binary search is possible.
answered by (27 points)  

Top Users Jul 2017
  1. Bikram

    3782 Points

  2. manu00x

    2464 Points

  3. Debashish Deka

    1832 Points

  4. joshi_nitish

    1494 Points

  5. Arnab Bhadra

    1096 Points

  6. Arjun

    1054 Points

  7. Hemant Parihar

    1050 Points

  8. Shubhanshu

    972 Points

  9. Ahwan

    876 Points

  10. akash.dinkar12

    642 Points

23,953 questions
30,895 answers
29,272 users