Computer Science
Intermediate

Nodes in a Full Binary Tree

Total nodes in a perfect binary tree of height h.

Formula

N=2h+11N = 2^{h+1} - 1

Variables

hHeight

Example

A full binary tree of height 3 has 2⁴ − 1 = 15 nodes.

Did You Know?

A full binary tree of height h holds 2^(h+1)−1 nodes — growth that explains why balanced trees stay shallow.