recategorized by
2,702 views

1 Answer

5 votes
5 votes

First,let's define a node's path -length and internal path length of a tree:

A node's path length can be defined as no. of links(or edges) it needs to traverse to reach the root of the tree.And an internal node's path length($$I_{k},where\:I_{k}\:is\:path\:length\:of\:k^{th}\:internal\:node\:where\:k\in \left \{x:x\: is\:an\:internal\:node \right \}$$)is simply path length of any internal node of the tree.

Internal-path length(L) can be defined as a summation of path lengths of all internal nodes of a tree:-

or, L=$\sum I_{k},\forall k\in \left \{ x:x\:is\:an\:internal\:node \right \}$

Now,to calculate internal path length,let's traverse the graph in a BFS i.e level wise and compute path length of internal nodes which is just an edge away from the root,then calculate the nodes which are 2 edges away from the root and so on.

path_length_level_wise
     
     
     
     
     

 Please ignore the above table.I'm not able to delete it.

path_length_level_wise
Level Nodes(k) $\sum I_{k,l},\forall k \in level(l)$
0 {A} 0
1 {B,C} 1+1=2
2 {E,I,J} 2+2+2=6
3 {F,L} 3+3=6
  {A,B,C,E,I,J,F,L} 0+2+6+6=14

So, the answer is 14 or option(b)

Answer:

Related questions

1 votes
1 votes
0 answers
1
Akriti sood asked Mar 24, 2017
1,886 views
can someone pls explain how is the internal path length of complete binary tree is O(n logn)? (if it is correct)
2 votes
2 votes
1 answer
2
0 votes
0 votes
2 answers
3
sripo asked Dec 25, 2018
4,805 views
In a 3-array tree if internal nodes have exactly 3 children,the number of leaf nodes will be __ ?Does it vary for binary tree?What do you mean by internal nodes? Non roo...