This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: Relating Internal and External Path Lenghts Definition 0.1 A Full Binary Tree is a tree where every node has either 0 or 2 children. Definition 0.2 Let T be a tree. The leaves of T are the nodes at the bottom that have no children. The internal nodes of T are the nodes that are not leaves. The following Lemma will be proven by you on the HW Lemma 0.3 If T is a full binary tree then the number of leaves is one more than the number of internal nodes. Theorem 0.4 In a full binary tree with N nodes, external path length E , and internal path length I , E = I + N- 1 . STAB AT PROOF by mathematical induction: Consider a full binary tree. Consider some leaf p . Make it the parent of two new leaves. Let s be the length of the path from the root to p . Consider how the internal path length changes. The node p is now an internal node with distance s from the root. So I I + s Consider how the external path length changes. The node p is no longer a leaf, but there are now two new leaves each with distance...
View Full Document
This note was uploaded on 12/04/2011 for the course CMSC 250 taught by Professor Staff during the Spring '08 term at Maryland.
- Spring '08