
8.6 Searching and Sorting Arrays 505
Figure 8.20
Output from Example
8.13
8.6 Searching and Sorting Arrays
Arrays are great instruments for storing a large number of related values.
As seen earlier in this chapter, we can use arrays to store daily temperatures,
CD titles, telephone bills, quiz grades, and other sets of related values. Once
the data is stored in an array, we will want to manipulate that data. A very
common operation is searching an array for a specific value.
8.6.1 Sequential Search of an Unsorted Array
Let’s assume you are the manager of a DVD rental store. Each member cus-
tomer gets a card with a unique member ID. You have decided t