Professional Documents
Culture Documents
C
Recurrences
Outcome
Students are able to derive a recurrence and initial conditions given
pseudo-code, or the name of a known algorithm.
2. ( What are the recurrence and initial conditions for the merge-
sort?
3. (
Multi-precision multiplication of integers. Suppose X and Y
are two n-bit integers written in binary notation. Assume n is
even and break X and Y into two (n/2)-bit integers A, B, and C,
D, respectively, so
Outcome
Students are able to solve various recurrences.
Greedy Algorithms
Suppose you are given a connected graph G where each edge has a
non-negative weight.
Outcome
Students know vocabulary.
Outcome
Students can derive or locate algorithms that correctly compute solu-
tions to a problems.
Outcome
Students can compile, debug, and profile their code. to solutions to
problems.
P( j, m) = P( j − 1, m) if w j > m
P( j, m) = max P( j − 1, m), p j + P( j − 1, m − w j ) if w j ≤ m
P(0, m) = p0 if w0 ≤ m
P(0, m) = 0 if w0 > m
j 0 1 2 3 4 5 ... 30
0 0 0 1 1 1 1 ... 1
1 0 0 1 2 3 3 ... 3
2 0 0 1 2 2 3 ... 6
3 0 0 1 2 2 3 ... 11
4 0 0 1 2 2 3 ... 17
5 0 0 1 2 2 3 ... 18