In Chapter 7, two searching algorithms were
presented and discussed: sequential search and binary search. A sequential
search begins looking in the list at the first item and continues looking at
each successive item until the item is found or the end of the list is reached.
A binary search assumes the list items are ordered and begins looking in the
middle of the list and successively throws away half of the list with each
comparison until the item is found or there is nowhere else to look.
In this lab, you will experiment with each of
these algorithms by looking for items in the list and recording whether or not
the item has been found. The number of comparisons is a metric that is often
used to measure searching efficiency, so record the number of comparisons with
the item.
Go to each of the pages listed below and
follow the directions.