Let H,πΌ, πΏ, and π represent height, number of internal nodes, number ofβ¦
2024
Let H,πΌ, πΏ, and π represent height, number of internal nodes, number of leaf nodes, and the total number of nodes respectively in a rooted binary tree.
Which of the following statements is/are always TRUE?
- A.
πΏ β€ πΌ + 1
- B.
π» + 1 β€ π β€ 2π»+1 β 1
- C.
π» β€ πΌ β€ 2π» β 1
- D.
π» β€ πΏ β€ 2π»β1
Attempted by 212 students.
Show answer & explanation
Correct answer: A, B, C
Key insight: relate counts of nodes with 0, 1, and 2 children.
Let n0 be the number of leaves (L), n1 the number of nodes with one child, and n2 the number of nodes with two children.
Every binary tree satisfies n0 = n2 + 1 (this follows from counting child pointers or by induction).
The number of internal nodes is I = n1 + n2, and since n1 β₯ 0 we get
L = n2 + 1 β€ n1 + n2 + 1 = I + 1.
Thus L β€ I + 1 always holds. Equality occurs when n1 = 0, i.e., in full (proper) binary trees where every internal node has two children.