external path length
Given a binary tree , construct its extended binary tree
.The external path length
of is then defined to be the sum of the lengths of the paths to each of the external nodes.
For example, let be the following tree.
The extended binary tree of is
The external path length of (denoted ) is
The internal path length of is defined to be the sum of the lengths of the paths to each of the internal nodes. The internal path length of our example tree (denoted ) is
Note that in this case , where is the number of internal nodes. This happens to hold for all binary trees.