Perfect Binary Tree
- Explain why the height of a complete binary tree is .
A perfect binary tree is a binary tree in which all interior nodes have two children, and all leaves have the same depth or same level

The height of a perfect binary tree is , where is the number of nodes.
You can verify this by looking at the example above: a perfect binary tree has node at level (depth) , nodes at level , nodes at level , and so on. Thus, it will have nodes at level . Adding these quantities, the total number of nodes for a full binary tree with depth is:
For example, the full binary tree of depth above has nodes.
Now, considering the formula above for the number of nodes in a full binary search tree:
Solving for , we get:
We know the height of the tree is the depth of the deepest node. So the height of a perfect binary tree is at most or .
Resources
- How to Sum Consecutive Powers of 2.
- Wikipedia's entry on Types of Binary Tree.
- Wikipedia's entry on Properties of Binary Trees.