Binary search
From Coderwiki
More actions
A binary search is a search algorithm which works by discarding half of an array, list or other collection in order to speed up search time.
Advantages of a binary search
- Almost always faster than a linear search
Disadvantages of a binary search
- Slower than a linear search on very small datasets
- Still very simple, but slightly more complex to implement
- The collection must be in order