799 views

3 Answers

Best answer
3 votes
3 votes
There is no way to index the elements in the linked list which makes it unsuitable for binary search.
selected by
2 votes
2 votes
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.
0 votes
0 votes
in binary search of an array we have the array size mentioned .Even if the size isn’t mentioned we can use an index and multiply it by 2 and we can easily find the end of the array in $O(\log n$) time.but if we want  to find the end of the list or find the mid we need to traverse the entire linked list so its $O\left (  n \right )$and anything after that will not effect as it will be $O\left ( \ n \right )$+$O\left ( \log n \right )$ = $O\left ( \ n \right )$.
So it is not suitable for linked lists.

Related questions

4 votes
4 votes
4 answers
2
Parshu gate asked Nov 27, 2017
6,669 views
How many different binary search trees can be constructed using six distinct keys? 256 128 132 264
10 votes
10 votes
3 answers
3
Chandramani Adil asked Aug 16, 2017
1,473 views
Suppose the first step in binary search algorithm is changed to M = (9L+R)/10, we know that the complexity of binary search is log(n). What will be the complexity of modi...
2 votes
2 votes
2 answers
4
vivekpinto07 asked Jun 24, 2016
2,941 views
If the binary search algorithm determines that the scanned argument is in upper half of the array,which of the following statement will set the appropriate variable to th...