Aspire's Library

A Place for Latest Exam wise Questions, Videos, Previous Year Papers,
Study Stuff for MCA Examinations - NIMCET

Previous Year Question (PYQs)



In a ternary tree, the number of internal nodes of degree $1,2$ and $3$ is $4,3$ and $3$ respectively. The number of leaf nodes in the ternary tree is:






Solution

For a tree,

Number of leaf nodes is

$n_0=1+\sum (i-1)n_i$

Here,

$n_1=4,\ n_2=3,\ n_3=3$

So,

$n_0=1+(1-1)n_1+(2-1)n_2+(3-1)n_3$

$=1+0(4)+1(3)+2(3)$

$=1+3+6$

$=10$

Therefore, the number of leaf nodes is $10$.



Online Test Series,
Information About Examination,
Syllabus, Notification
and More.

Click Here to
View More


Online Test Series,
Information About Examination,
Syllabus, Notification
and More.

Click Here to
View More

Ask Your Question or Put Your Review.

loading...