How does binary search give benefit over sequential search?
Answers
Answered by
0
A binary search comes with the prerequisite that the data must be sorted. ... Just remember that sorting data, even with the most efficient algorithm, will always be slower than a linear search (the fastest sorting algorithms are O(n * log n)). So you should never sort data just to perform a single binary search later on.
Answered by
0
A binary search comes with the prerequisite that the data must be sorted. ... Just remember that sorting data, even with the most efficient algorithm, will always be slower than a linear search (the fastest sorting algorithms are O(n * log n)). So you should never sort data just to perform a single binary search later
Similar questions