Saint Louis University |
Computer Science 314
|
Dept. of Math & Computer Science |
Topic: Divide and Conquer
Related Reading: Ch. 5
Due:
Friday, 18 April 2008, 1:10pm
Please make sure you adhere to the policies on academic integrity.
See "Solved Exercises" in Chapter 5 of text
Exercise 1 of Chapter 5 (p. 246)
Exercise 3 of Chapter 5 (p. 247)
Exercise 6 of Chapter 5 (p. 248)
The goal of this problem is to generate a schedule for a round-robin tournament among n teams (where we make the simplifying assumption that n is a power of 2). Formally, a round robin is a schedule of head-to-head games that can be described as a series of n-1 rounds, such that for each team t.
As an example, here is a simple schedule for 4 teams.
Week 1 | Week 2 | Week 3 |
---|---|---|
1 vs. 2 | 1 vs. 3 | 1 vs. 4 |
3 vs. 4 | 2 vs. 4 | 2 vs. 3 |
Your goal is to describe a divide-and-conquer algorithm for generating a valid round robin for n teams. Justify the correctness of your approach and analyze its running time.
In Exercise 3 of the text, you developed an O(n log n) time algorithm for finding an equivalent cluster of cards.
It is actually possible to solve this problem in O(n) worst case time. Develop and analyze such an algorithm.
Exercise 7 of Chapter 5 (pp. 248-249)