CS 460, Spring, 2010

Lab 5: Divide and Conquer



The purpose of this lab is to investigate applications of the divide-and-conquer method for algorithm design. You will do two problems, each a choice from two.


In addition to developing an algorithm for each problem, you will need to prove that the algorithm solves the problem and give a complexity analysis in terms of the problem size.


Your description of the algorithm must be completely precise and should include a description of the data representation used, so that operations accessing the data can be included in the analysis. A precise English description, precise pseudo-code, or a complete program in a language of your choice is acceptable.

Test Cases

You should provide test cases to demonstrate how your algorithms work. The test case for each algorithm should be small, but without making the application of the algorithm trivial. You should show how the step-by-step application of your algorithm works. You might want to do two such test cases to show differing outcomes of the algorithm when appropriate.



The problems for this lab are taken from the exercises for chapter 5 in K&T.


Do either 1 or 2 and either 4 or 5.


Bonus: Do the other problem from 4 or 5.