Binary Search & Balanced Trees


Answer & solution
Answer: Exactly 2^(h−1). (no official key was published)
The level at distance h−1 is full, so it contains 2h−1 nodes. To justify fullness rather than assume it, first use the proved size bound: a size-balanced tree of height h has N≥2h nodes.
For any node whose subtree has s nodes, its child sizes sum to s−1 and differ by at most one. Hence each child has at least floor((s−1)/2) nodes. Starting from N≥2h, induction on depth shows that every node at depth d≤h−1 has subtree size at least 2h−d−1. Indeed, a parent lower bound 2h−d−1 gives each child at least 2h−d−1−1.
In particular, at every depth d<h−1 this lower bound is at least 3. Such a subtree has both children nonempty. Beginning with one root, the node count therefore doubles at each step until depth h−1, giving exactly 2h−1 nodes there. The last level h may be only partly occupied, so this does not assert that the entire tree is perfect.
For h=1 the requested level is the root itself and the formula gives 1. For h=2 a smallest example has four nodes: its depth-1 level still has both children, while only one node need occur at depth 2. The paper explicitly states h≥1.