Solving Problems ◾ 113
As an example of decomposing data, we examine two search algorithms.
A search algorithm is a method for examining a group of data items in
order to nd an item with some particular property.
e most intuitive of all search algorithms is linear search. A linear
search requires that the group of items be arranged one aer another
from rst to last. e algorithm consists of examining the rst item, then
the second, the third, the fourth, and so on, until the desired item has
been found.
As an example of a linear search, suppose you were given a stack of
award certicates and told that one of the awards might be awarded to
you. A linear search would proceed as follows looking for your certicate
in a stack of 500