Searching is an important and very common operation that computers do all the time. Searches are used every time someone does a ctrl-f for “find,” when a user uses “type-to” to quickly select an item, or when a web server pulls information about a customer to present a customized web page with the customer’s order.
There are a lot of ways to search for data. Google has based an entire multibillion dollar company on this fact. This chapter introduces the two simplest methods for searching: the linear search and the binary ...