edited by
828 views
0 votes
0 votes
A 5-ary  tree is a tree in which every internal node has 3 children.The number of leaf nodes in such a tree with 10 internal nodes is______
edited by

2 Answers

Best answer
3 votes
3 votes

Here we need 2 equations ,

a) No of edges = No of vertices - 1 [ Basic definition of tree ]

b) Handshaking theorem i.e. sum of degree = 2 * no of edges

Say no of leaf nodes = x

Hence sum of degree due to leaf nodes = x

Now for non root nodes , degree = 4 as 1 due to parent and 3 due to 3-ary ness of tree..

For root node , degree = 3..

Hence ,

        Sum of degree =  2 * no of edges

==>  3 + 9 * 4 + x  =  2 * ( x + 10 - 1 )   [ As no of edges = no of vertices - 1 and no of vertices = x + 10 ]

==>  39 + x  =  2x + 18

==>  x   =  21

Hence no of leaf nodes = 21

selected by
4 votes
4 votes
in any n array tree

total no. of nodes = i*n + 1 where i is the no. of internal nodes , one for the root node

now Total nodes = 10*3+1 = 31

we can also write total nodes as (No. of leaf nodes(L) + No. of internal nodes(i))

hence L+i=31

L=31-i

  =31-10

  =21 is the answer

Related questions

–4 votes
–4 votes
2 answers
1
Souvik33 asked Oct 27, 2022
636 views
*MSQ*The following figure depicts a a. A tree and only treeb. A tree with 3 nodesc. A graph (Since every tree is a graph)d. A graph and only graph
0 votes
0 votes
1 answer
2
once_2019 asked Jun 24, 2018
630 views
Is the root node an internal node?
1 votes
1 votes
1 answer
3
rahul sharma 5 asked Apr 12, 2018
695 views
a:) If given Tree is BST = Inorder of keys is sortedb:) Inorder of keys is sorted = Tree is BST(converse of above)I know first one holds.Is second one also true?If not ca...
2 votes
2 votes
0 answers
4
Lakshman Bhaiya asked Nov 14, 2017
262 views