In a binary tree, the number of internal nodes of degree 1 is 5, and the…
2006
In a binary tree, the number of internal nodes of degree 1 is 5, and the number of internal nodes of degree 2 is 10. The number of leaf nodes in the binary tree is
- A.
10
- B.
11
- C.
12
- D.
15
Attempted by 400 students.
Show answer & explanation
Correct answer: B
Answer: 11
Given: number of internal nodes with one child = 5, number of internal nodes with two children = 10.
Count edges by summing children: edges = 1*5 + 2*10 = 25.
Count edges using total nodes: if L is the number of leaves, total nodes = 5 + 10 + L, so edges = (5 + 10 + L) - 1 = 14 + L.
Equate the two expressions: 25 = 14 + L, hence L = 11.
Therefore the number of leaf nodes in the binary tree is 11.
A video solution is available for this question — log in and enroll to watch it.