Asymptotic Analysis & Recurrences

Answer & solution
Answer: B (no official key was published)
1. In a perfect balanced tree with n leaves, the root costs n/2, the two children together cost n/2, and every internal level similarly costs n/2. There are log2 n internal levels, so this supplies a Θ(n log n) worst-case lower bound.
2. For any balanced tree, at each depth the subtrees are disjoint and the sum of their leaf counts is at most n; summing min(left leaves,right leaves) at that depth is at most n/2. Height O(log n) gives O(n log n), with traversal overhead O(n).
3. Thus worst-case Θ(n log n), B, assuming the usual balanced binary-tree model.
4. Teaching check: For n=8 in a perfect tree, the root cost is 4, the next level totals 4 and the next totals 4, giving 12 before traversal bookkeeping. Each internal level contributes n/2, and there are log2 n such levels. Counting only the root misses the repeated per-level work.