###### Operating-Systems

October 10, 2023###### Nielit Scentist-B [02-12-2018]

October 10, 2023# Nielit Scentist-B [02-12-2018]

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 | |

(n-1)/n | |

(n-1) |

Question 2 Explanation:

→ Any n-ary tree in which every node has either 0 or n children will take L=(n-1)*I +1

[ Where L is the number of leaf nodes and I is the number of internal nodes]

→ Given data n=3.

L=(3-1)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=(3-1)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 n-ary tree in which every node has either 0 or n children will take L=(n-1)*I +1

[ Where L is the number of leaf nodes and I is the number of internal nodes]

→ Given data n=3.

L=(3-1)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=(3-1)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