21,281 views

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. $10$
2. $11$
3. $12$
4. $15$

### 1 comment

Although @Kai and @Arjun ji has provided good answer with reference. But before looking at their answer just try considering tree as directed graph.

A node in a binary tree has degree $0, 1$ or $2$.

We are given no. of $1$ degree node $= 5$, no. of $2$ degree nodes $= 10$.

Total no. of edges $= 1*5 + 2*10 = 25$ (In tree degree is for outgoing edges only, and hence each degree corresponds to an edge)

So, total no. of nodes $= 25 + 1 = 26$ (No. of nodes in a tree is $1$ more than no. of edges).

Now, no. of leaf  nodes (nodes with $0$ degree) $= 26 - 5 - 10 = 11$.

Correct Answer: $B$

by

see this "A binary tree is a directed graph and hence degree refers to outgoing degree only. We can also consider it as an undirected graph and apply graph rules- but by default it is a directed graph. " by arjun sir

just drawing an arbitrary tree with "the number of internal nodes of degree 1 is 5, and the number of internal nodes of degree 2 is 10."- we can calculate it.
just the idea ...what will its graph look like?
In a binary Tree,

no of nodes of degree 2 = no of leaves - 1.

No of nodes of degree 1 do not affect no of leaves !

No of leafs = No of nodes of degree 2 + 1 = 10 + 1 = 11

@arjun Sir

@gatecse

A binary tree is a directed graph and hence degree refers to outgoing degree only. We can also consider it as an undirected graph and apply graph rules- but by default it is a directed graph.

Why this definition is not using in this:   https://gateoverflow.in/118300/gate2017-1-20

val because in GATE2006 question we are using the definition of a tree defined in DATA STRUCTURES but in GATE2017 we are using the definition of a tree as a graph defined in GRAPH THEORY

NOTE: notice the word 10 vertices.

it must be no. of leaves =number of nodes of degree 2 +1 .
In a directed graph indegree of a graph = outdegree

Outdegree = 1*5 + 2*10

Let number of leaves be x

Indegree = x*1 + 14 *1 (all nodes except root have indegree = 1)

Outdegree = indegree

x = 11
by
$L$ = $T+ 1$

$L$ = number of leaf node

$T$ =  number of nodes with 2 child

$L =10+1$

$L= 11$