02/21/00
COM1100 Winter2000 Yuhong Yin
8
Binary Search
nIn the first case, the search has been successful, and no further searches are required.
nIn the second case, since the desired item is greater than the middle element, if it s found at all it must be in the upper part of the list. This means that the lower part of the list consisting of all elements from the list to the midpoint elements can be discards from any further search.
nIn the third case, since the desired item is less than the middle element, if it s found at all it must be in the lower part of the list. This means that the upper part of the list consisting of all elements from the midpoint to the end of the list can be discards from any further search.
n