Binary Trees - 2
Theorem. In a complete binary tree with n vertices and
height H,
2H <= n < 2H+1.
Proof.
- The number of possible vertices in layer k is
2k .
- If all of the layers through layer k are full, then the number
of vertices in the first k layers is the sum
1 + 2 + 4 + ... + 2k = 2k+1 - 1 .
- Substitute k = H - 1 : there are 2H
- 1 vertices in the first H - 1 layers.
- Therefore there are at least this many plus one, i.e., 2H, vertices in the tree. That is,
2H <= n .
- Substitute k = H: the maximum number of vertices is 2H+1 - 1,
which is smaller than 2H+1 .
- Therefore, n < 2H+1.
|