
We simplify our task by counting only the number of comparisons performed in the sequential search (Step 7).
The worstcase number of comparisons is This occurs when Name is last in the phone book or does not occur in the phone book. The best case number of comparisons is 1, if NAME is first in the phone book. If NAME is in the phone book, then the average number of comparisons is n/2.

CS1104 Main Page
Last Updated 01/05/2000
© L.Heath, 2000