CMSC-341, Fall 1999, Sections 0101
Binary Trees
- Binary Tree
- Full Binary Tree
- Theorem : A FBT with n interior nodes has n+1 exterior node (leafs)
- Perfect Binary Tree
- Theorem: The number of nodes in a PBT is always 2h + 1 - 1
where h is the height of the tree.
- Complete Binary Tree
- Augmented Binary Tree
- Theorem: There are n+1 NULL pointers in a Binary Tree of n nodes.
- Theorem (Relationship between Internal Path Length (IPL) and External
Path Length (EPL) of a Full Binary Tree:
E(ni) = I (ni) + 2 * ni
where
-
- E(ni) = EPL of an FBT that has i internal nodes
- I (ni) = IPL of an FBT that has i internal node
- Theorem (resulting from above): The IPL of an augmented BT with
n internal nodes is
I(n) = I (nL) + I(n - nL - 1) + n - 1
- Reconstructing Binary Trees from traversals
- in-order
- pre-order
- post-order