The degree of a node in a tree is the number of children the node has. If a tree has n1 nodes of degree 1, n2 nodes of degree 2, ..., nm nodes of degree m, compute the number of leaves in the tree in terms of n1, n2, . . . , nm.
Algorithms
1
Posts
1
Posters
0
Views
1
Watching
-
Full question is below . Consider a complete binary tree with an odd number of nodes. Let n be the number of internal nodes (non-leaves) in the tree. Define the internal path length, I, as the sum, taken over all the internal nodes of the tree, of the depth of each node. Likewise, define the external pathlength, E, as the sum, taken over all the leaves of the tree, of the depth of each leaf. Show that E = I + 2n Can some one guide me for the above subject line I greatly appreciate Thanks in Advance...