OperatingSystems
October 10, 2023Nielit ScentistB [02122018]
October 10, 2023Nielit ScentistB [02122018]
Question 2

___ number of leaf nodes in a rooted tree of n nodes, where each node is having 0 or 3 children.
n/2


(2n+1)/3


(n1)/n


(n1)

Question 2 Explanation:
→ Any nary tree in which every node has either 0 or n children will take L=(n1)*I +1
[ Where L is the number of leaf nodes and I is the number of internal nodes]
→ Given data n=3.
L=(31)I +1
=2I +1 ————> 1
→ To find total number of nodes is nothing but sum of leaf nodes and internal nodes
n=L+I ————> 2
With the help of 1 and 2, we get L =(2n+1)/3/
[ Where L is the number of leaf nodes and I is the number of internal nodes]
→ Given data n=3.
L=(31)I +1
=2I +1 ————> 1
→ To find total number of nodes is nothing but sum of leaf nodes and internal nodes
n=L+I ————> 2
With the help of 1 and 2, we get L =(2n+1)/3/
Correct Answer: B
Question 2 Explanation:
→ Any nary tree in which every node has either 0 or n children will take L=(n1)*I +1
[ Where L is the number of leaf nodes and I is the number of internal nodes]
→ Given data n=3.
L=(31)I +1
=2I +1 ————> 1
→ To find total number of nodes is nothing but sum of leaf nodes and internal nodes
n=L+I ————> 2
With the help of 1 and 2, we get L =(2n+1)/3/
[ Where L is the number of leaf nodes and I is the number of internal nodes]
→ Given data n=3.
L=(31)I +1
=2I +1 ————> 1
→ To find total number of nodes is nothing but sum of leaf nodes and internal nodes
n=L+I ————> 2
With the help of 1 and 2, we get L =(2n+1)/3/
Subscribe
Login
0 Comments