Part 1: brute force method
|
Part 3: divide-and-conquer
|
This is definitely the hardest (and most educational) part of the assignment.
First, make sure that you understand the concept of
divide-and-conquer.
Divide means break the problem up into two
smaller subproblems. You will conquer each of these halves
recursively. The key to divide-and-conquer is then combining the solutions
to the two subproblems to arrive at a solution to the original problem.
If you don't understand the code for quicksort (Sedgewick,
Program 7.1) and mergesort (Sedgewick, Program 8.3) after doing
the relevant readings, see your preceptor, as this material
is critical if you hope to write your own divide-and-conquer
algorithm.
Kevin Wayne