11.6 S e a rching | 555ant
cat
chicken
cow
deer
dog
fish
goat
horse
rat
snake[0]
[1]
[2]
[3]
[4]
[5]
[6]
[7]
[8]
[9]
[10]
[0]
[1]
[2]
[3]
[4]
[5]
[6]
[7]
[8]
[9]
[10]
[0]
[1]
[2]
[3]
[4]
[5]
[6]
[7]
[8]
[9]
[10]
[0]
[1]
[2]
[3]
[4]
[5]
[6]
[7]
[8]
[9]
[10]
firstmiddlelastFirst iteration
bat < dogant
cat
chicken
cow
deer
dog
fish
goat
horse
rat
snakefirstmiddlelastSecond iteration
bat < chicken
(a) (b)(c) (d)bat cannot be
in this part
of the listbat cannot be
in this part
of the listant
cat
chicken
cow
deer
dog
fish
goat
horse
rat
snakefirst and middle
lastThird iteration
bat > antant
cat
chicken
cow
deer
dog
fish
goat
horse
rat
snakefirst, last,
and middleFourth iteration
bat < catbat cannot be
in this part
of the listFigure 11.10 Walk-through of Binary Search Algorithm