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]
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. (Give a careful proof.)
What is the area used by a drawing of this kind? Θ(n), Θ(n2)? Explain your reasoning.