In a complete -ary tree, every internal node has exactly children. The number of leaves in such a tree with internal node is:
View worked solution
Answer: C
We can determine the number of leaves in a complete -ary tree by establishing a relationship between the total number of nodes, internal nodes, and leaves.
Let:
- = number of internal nodes
- = number of leaf nodes
- = total number of nodes in the tree
By definition, the total number of nodes is the sum of internal nodes and leaf nodes:
Since every internal node has exactly children, the total number of children in the tree is . In any tree, every node except the root is a child of some node. Therefore, the total number of nodes is also given by:
Equating Equation 1 and Equation 2:
Solving for :
Thus, the number of leaves is , which corresponds to Option C.
Free practice · Your answers on this page are not saved.
