greedy(T, c[1..N]) (assumption: c[1] <= c[2] <= ... <= c[N]) for i = N, N-1, ..., 1 k = int(T/c[i]) print "number of coins of denomination ", c[i], ": ", k T = T - k*c[i]
<ol>
Is it the case that, for these denominations, for any positive integer T, the greedy algorithm makes change totaling T using the minimum possible number of coins?
Think about this and get as much certainty as you can about the answer, and then explain your reasoning.
Let W(n) denote the width of the drawing for a tree with n leaves. Let H(n) denote the height. Then these functions satisfy the following recurrence relations:
Now consider the following way of laying out the tree:
let L(n) denote the width (and height) of this kind of drawing for a tree with n leaves. Then L(n) satisfies the recurrence relation
What is the value of L(n)? That is, is L(n) = Θ(n)? Is it Θ(n2)? Explain your reasoning.
What is the area used by a drawing of this kind? Θ(n), Θ(n2)? Explain your reasoning.
</ol>