Algorithms


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, ..., N10,000 is divided into subproblems:

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

2. Finding NAME in the list Ni+1, ..., N10,000.

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

Click on START to set up the problem, and then click on STEP to cycle through the successive steps of the search algorithm. As each row is examined and found not to be the desired item, the list to be searched is reduced by that row, thus starting a new problem of locating the item in the new smaller list.

What is the value corresponding to in the following list?:











[Prev][TOC][Next]


CS1104 Main Page
Last Updated 2001/10/04
© L.Heath, 2000, and extensively modified by J.A.N. Lee, 2001.