 |
|
The binary algorithm makes progressively better guesses as to where the result is in an array
It evaluates the middle element of an array. If the array value is higher than the search value, the algorithm discards every higher value as none of these can be the answer.
If the array value is lower than the search value, the algorithm discards every lower value, as none of these can be the answer.
The algorithm continues until it finds an answer. The algorithm quits when it has eliminated every memory location.
|