220 views
1 1 vote

A binary tree has the following properties:

  • The number of nodes with exactly two children is $12$
     
  • The number of nodes with exactly one child is $5$
     

Which of the following statements is/are correct?

  1. The number of leaf nodes is $13$
     
  2. The total number of nodes in the tree is $30$
     
  3. The number of edges in the tree is $29$
     
  4. The height of the tree must be at least $6$

1 Answer

0 0 votes
Let

$\mathrm{n}_2=$ number of nodes with exactly two children $= 12$

$n_1=$ number of nodes with exactly one child $= 5$

$\mathrm{n}_0=$ number of leaf nodes

For any binary tree,

$$
\mathrm{n}_0=\mathrm{n}_2+1
$$

So,
$$
n_0=12+1=13
$$

Statement A is correct.

 

$\text { Total nodes }=\mathrm{n}_0+\mathrm{n}_1+\mathrm{n}_2$

$=13+5+12$

$ =30$

Statement B is correct.
 

In any tree,

edges $=$ nodes $-1$

So, edges $=30-1=29$

Statement C is correct.
 

The height is not atleast $6.$

D is false.
Answer:
Position:
Show:

Related questions

0 0 votes
1 1 answer
178
178 views
GO Classes asked Dec 29, 2025
178 views
Consider the following Python code:funcs = [] for i in range(3): def f(): return i funcs.append(f) print(funcs[0](), funcs (), funcs ())What will be p...
1 1 vote
1 1 answer
214
214 views
GO Classes asked Dec 29, 2025
214 views
Consider the following Python code:for i in range(1, 5): if i % 3 == 0: break else: print("A") print(i)What is the output?$\verb|AA3|$ $\verb|3|$ $\verb|A...
0 0 votes
1 1 answer
172
172 views
GO Classes asked Dec 29, 2025
172 views
Consider the following Python code:x = 5 lst = [x * i for i in range(3)] x = 10 print(1st)What is the output?$\verb|[0,5,10]|$ $\verb|[0,10,20]|$ $\verb|[0,5,10,15]|$ Rai...
0 0 votes
1 1 answer
224
224 views
GO Classes asked Dec 29, 2025
224 views
Consider the following Python code:def modify(x): x[0] = x[0] + 1 x = x + [10] a = [1, 2, 3] modify(a) print(a)What will be the output?$\verb|[1,2,3]|$ $\verb...