bugzpodder wrote:
Definition: Search a sorted array by repeatedly dividing the search interval in half. Begin with an interval covering the whole array. If the value of the search key is less than the item in the middle of the interval, narrow the interval to the lower half. Otherwise narrow it to the upper half. Repeatedly check until the value is found or the interval is empty.
Or in other words, the old game of guess the number. Let's say I tell you to guess a number between 1 and 10. You get three guesses.
The answer: 3
First guess: 5
Too high!
Next Guess: 2
Too low!
Final guess: 3 (the only other option is 4)
Correct!