retagged by
13,563 views
44 votes
44 votes

The weighted external path length of the binary tree in figure is ______

retagged by

2 Answers

Best answer
66 votes
66 votes
This is straightforward. The nodes of the given tree are given in square boxes. The weights associated with the nodes are the numbers example $15,9,10$ etc.

Weighted path length $=\sum$ (for(each node in the tree) (path length)$*$(weight of the node) ).

                                        $= \displaystyle{}\sum_{i=1}^{n} \text{Path  Length}_{i} \ast  \text{Weight  of  Node}_{i} $

So answer (written in path_length * weight form) $ = 4*2 + 4*4 + 4*5 + 4*7 + 3*9 + 3*10 + 1*15 = 144.$
edited by
10 votes
10 votes
I am not so sure, But will it be like this?

4+2 = 6

7+5 = 12

12+6 = 18

9+10 = 19

18+19 = 37

37+15 = 52.

So total 52.

Or will it be

=> 4(4+2) + 4(5+7) + 3(9+10) + 1(15)

=> 24 + 48 + 57 + 15

=> 144.
Answer:

Related questions

31 votes
31 votes
2 answers
1
Akash Kanase asked Apr 18, 2016
2,950 views
Consider the binary tree in the figure below:Outline a procedure in Pseudo-code to delete an arbitrary node from such a binary tree with $n$ nodes that preserves the stru...
20 votes
20 votes
3 answers
2
Akash Kanase asked Apr 18, 2016
3,451 views
Consider the binary tree in the figure below:Give different steps for deleting the node with key $5$ so that the structure is preserved.
25 votes
25 votes
3 answers
3
Kathleen asked Sep 12, 2014
4,249 views
Consider the binary tree in the figure below:What structure is represented by the binary tree?
20 votes
20 votes
5 answers
4
Kathleen asked Sep 12, 2014
5,374 views
If the binary tree in figure is traversed in inorder, then the order in which the nodes will be visited is ______