How is Sequential Search like Divide and Conquer?

Each time through the body of the repeat loop, the problem of finding Name in the list Ni, Ni+1, ..., N10000 is divided into subproblems:

1. Finding NAME in the one-element list Ni; and

2. Finding NAME in the list Ni+1, ..., N10000.

We have, in essence, peeled off a very small subproblem in each iteration of the loop.


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