Tree Properties & Traversals

Answer & solution
Answer: C (no official key was published)
1. Approach. Check the two base cases: null contributes zero, and a node with no children contributes one. All other nodes merely add child results, so their own elements and depths are irrelevant.
2. Derivation and interpretation. GetValue returns zero for a null pointer, one when both children are null, and otherwise the sum of the values for the left and right subtrees. By induction on the tree, this counts precisely the leaves: an internal node adds no contribution of its own. Therefore C, the number of leaf nodes, is correct, including zero for an empty tree.