2 votes 2 votes closed as a duplicate of: MadeEasy Subject Test: Programming & DS - Trees A 4-ary i.e., either has 0 children or has 4 children tree has 20 leaf nodes. Then the total number of nodes in the tree are ________. Kaluti asked Jan 14, 2018 • closed Oct 10, 2023 by Hira Thakur Kaluti 351 views comment Share Follow See all 2 Comments See all 2 2 Comments reply Kaluti commented Jan 14, 2018 reply Follow Share my approach no of internal nodes = 20-1 = 19 now how to proceed further we can not use n = mi + 1 where m refers to arity of full tree but here it is not full tree 0 votes 0 votes srivivek95 commented Jan 14, 2018 reply Follow Share In a k-ary tree, the number of leaf nodes(L) is L=n(k-1)+1 where n is number of internal nodes so, 20=3n+1 n=6.33=7 So, total nodes=20+7=27 0 votes 0 votes Please log in or register to add a comment.
1 votes 1 votes N= 4* 20- 1/ 3= 79/3=26.33=27 nodes hope this helps u :) Pawan Kumar 2 answered Jan 14, 2018 Pawan Kumar 2 comment Share Follow See all 0 reply Please log in or register to add a comment.