in DS recategorized
2,167 views
3 votes
3 votes
The path length of a node is defined as the number of edges from root to that node. For a given full binary tree, the sum of path length of all leaf nodes is equal to $16$. The total number of internal nodes present is equal to $5$. What is the sum of path length of all internal nodes?

(Note: A full binary tree is a tree in which every node other than the leaves has 2 children)
in DS recategorized
2.2k views

4 Comments

Can confirm, in the test the options don't show.
0
0

@pritishcBut it happened two times for me..

once while writing the exam and when i opened the exam for screen shot.. I thought it was a problem for everyone. Thanks for confirmation :)

0
0

Can someone update with answer? and @Ruturaj Mohanty its still not showing options.

0
0

2 Answers

2 votes
2 votes
The answer is 5 as there are 3 Internal nodes according to this question out of which 2 internal node has path length 2 and 1 internal node has path length 1

Therefore, sum of path length = 2*2 +1 = 5.
0 votes
0 votes

In the question it isn't mentioned  if the tree is binary or complete. You can't draw a tree with internal path length 6 and 8 internal nodes. The internal path length should be at least 7(1 root node and 7 non-leaf, non-root node). Internal path length = 6 means there can be maximum 6 internal nodes with path length 1 from root, but internal nodes are mentioned 8. So, there has to be at least 7 nodes with path length 1 from root. Making internal path length 7!

Please verify!

1 comment

I have updated the description to full binary tree.
1
1
Answer:

Related questions