ABSTRACT

The binary search algorithm introduced in Chapter 5 is an efficient method for finding an item in an ordered collection. A real-world example of where this type of search is effective is looking for a book in a bookstore, where books in each section are arranged by the author’s last name. To find a book on algorithms by an author named Knuth, we could pick a starting location near the middle of the computer science section, and then move forward or backward in the section, at each step narrowing the range of places where the book might be found.