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  

  1. A.

    10

  2. B.

    11

  3. C.

    12

  4. 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.

  1. Count edges by summing children: edges = 1*5 + 2*10 = 25.

  2. 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.

  3. 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.

Explore the full course: Gate Guidance By Sanchit Sir