COMP 212
Written Assignment 1
Due 1:10 pm, March 6, 2000
All problems are of equal value.
- 1.
- (a)
- What is the smallest value of n such that an algorithm
with running time 10 n log n
runs faster than an algorithm with
running time n2?
- (b)
- Assume on inputs of size 1000 an algorithm with
running time 5 n2 takes one second to solve a problem on a
given computer. How large of an input could the algorithm solve in
one hour on the same computer?
- 2.
- Rank the following functions by order of growth; that is,
find an arrangement g1,
g2, g3,
g4, g5
of the functions
satisfying
g1
= O(g2), g2 = O(g3),
g3 = O(g4),
g4 = O(g5).
- 3.
- Solve the following recurrences for the case of n being a power
of 2, and C1 = 1:
- (a)
-
Cn = Cn/2 + n2
- (b)
-
Cn = 2 Cn/2 + n2
- 4.
- (a)
- Sedgewick, pg 147, Problem 4.9.
- (b)
- Sedgewick, pg 147, Problem 4.10.
- 5.
- (a)
- Sedgewick, pg 254, Problem 5.86.
- (b)
- Sedgewick, pg 255, Problem 5.90.
2000-02-24