Start with a worked example
Open the worked example for Maximum nodes. The example starts with Tree height = 4.
Tree Nodes Calculator formula
Nodes=2^(h+1)−1.
Inputs and units
| Input | Format / range | Example |
|---|---|---|
| Tree height | Whole number, min 0, max 52 | 4 |
Worked example
The values listed in Inputs and units give 31 for Maximum nodes.
- Maximum nodes
- 31
- Maximum leaves
- 16
Results and assumptions
Assumes a perfect binary tree with root at height 0.
Change Tree height from 4 to 5 and keep the other example inputs fixed. The updated answer is 63 (Maximum nodes).
Fix an input or unexpected result
Tree height is required. Enter tree height using the format and bounds in the input table. Zero and an empty field are different: use zero only if it is allowed and represents your data.
