• edited by
40,140 views
51 51 votes

The number of leaf nodes in a rooted tree of n nodes, with each node having $0$ or $3$ children is:

  1. $\frac{n}{2}$
  2. $\frac{(n-1)}{3}$
  3. $\frac{(n-1)}{2}$
  4. $\frac{(2n+1)}{3}$

8 Answers

0 0 votes

Let \( L \) = number of leaves, and \( I \) = number of internal nodes.

W.K.T. in a tree:

  • The number of edges is \( n-1 \).  ⇒  Total edges = \( 3 *  I  \)

     
  • Each internal node has 3 children, so contributes 3 edges.


We have:
\[
n = L + I
\]
Also,
\[
3I = n-1 \quad \Rightarrow \quad I = \frac{n-1}{3}
\]

Substituting:
\[
L = n - I = n - \frac{n-1}{3}
\]
\[
= \frac{3n - (n-1)}{3}
\]
\[
= \frac{2n+1}{3}
\]

Thus, the number of leaf nodes is:
\[
\boxed{\frac{2n+1}{3}}
\]


 

Answer:
Position:
Show:

Related questions

154 154 votes
10 answers 10 answers
39.1k
39.1k views
Kathleen asked Sep 15, 2014
39,148 views
A weight-balanced tree is a binary tree in which for each node, the number of nodes in the left sub tree is at least half and at most twice the number of nodes in the rig...
47 47 votes
4 answers 4 answers
21.1k
21.1k views
Kathleen asked Sep 15, 2014
21,097 views
Consider the following $32\text{-bit}$ floating-point representation scheme as shown in the format below. A value is specified by $3$ fields, a one bit sign field (with $...
32 32 votes
5 answers 5 answers
16.4k
16.4k views
Kathleen asked Sep 15, 2014
16,449 views
A device employing INTR line for device interrupt puts the CALL instruction on the data bus while:$\overline{\text{INTA}}$ is activeHOLD is activeREADY is inactiveNone of...
30 30 votes
2 answers 2 answers
5.0k
5.0k views
Kathleen asked Sep 15, 2014
4,996 views
Draw all binary trees having exactly three nodes labeled $A, B$ and $C$ on which preorder traversal gives the sequence $C, B, A$.