CSPP 570 Algorithms - Autumn 2001
Homework 3
Reading assignment
Please read chapters 8 (Quicksort) and 9 (sorting in linear time).
Written assignment (assigned October 9, due October 17)
This homework covers the material in chapter 7 of the
textbook, as well as review exercises on recurrences.
Please note: your solutions should be readable, and justifications
should be given for steps in the proofs. Elegance counts!
-
Solve the following recurrences. Prove your answers by induction.
You may assume that n has a convenient form (e.g., n is
a power of 3) if this is helpful.
(Each part is worth 5 points.)
-
T(n) = 1 if n = 1,
T(n) = 2T(n/2) + n3 otherwise.
-
T(n) = 1 if n = 1,
T(n) = T(7n/10) + n otherwise.
- Corrected: 10/15/01
T(n) = T(n/2) + T(n/3) +
n
You may assume that T(n) is a suitable constant for
n = 1, 2, and 3.
-
Do exercise 7.3-3 on page 147. (10 points)
-
Do exercise 7.4-2 on page 149. (10 points)
-
Do exercise 7.5-6 on page 151. (10 points)
-
Do problem 7-1 on page 152. (Each part is worth 5 points.)
-
Do problem 7-2 on page 152. (Each part is worth 2 points.)
-
Consider the following two statements about a function
f(n) > 1:
- f(n) = O(nlg n).
- f(n) = nO(lg n).
The notation in the second statement means that f(n) =
ng(n) for some function
g(n) which satisfies the relation g(n) =
O(lg n).
Answer the following questions:
- Does f(n) = nO(lg n)
follow from
f(n) = O(nlg n)?
- Does
f(n) = O(nlg n)
follow from
f(n) = nO(lg n)?
(Each part is worth 5 points.)
Gerry Brady
Tue Oct 9 13:42:10 CDT 2001