Homework Assignment

Divide and Conquer

Contents:


Overview

Topic: Divide and Conquer
Related Reading: Ch. 5
Due:

Please make sure you adhere to the policies on academic integrity.


Practice Problems


Problems to be Submitted (40 points)

  1. (10 points)

    Exercise 1 of Chapter 5 (p. 246)

  2. (10 points)

    Exercise 3 of Chapter 5 (p. 247)

  3. (10 points)

    Exercise 6 of Chapter 5 (p. 248)

  4. (10 points)

    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.

    1. t is scheduled to play precisely one game per round.
    2. Over the course of a tournament, t plays precisely one game against each possible opponent.

    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.


Extra Credit

  1. (4 points)

    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.

  2. (4 points)

    Exercise 7 of Chapter 5 (pp. 248-249)


Last modified: Tuesday, 29 April 2008