Work out tree height and nodes instantly with clear inputs, formula shown and shareable results.
A perfect b-ary tree of height h has bᵏ nodes at level k, so the total is the geometric sum (b^(h+1) − 1)/(b − 1). The deepest level alone holds bʰ leaves.
Total nodes
N = (b^(h+1) − 1) / (b − 1)
Leaves
L = bʰ
(3⁵ − 1)/2 = 121 nodes, of which 81 are leaves.
Because n grows exponentially with height, so the height — and hence the search depth — grows only logarithmically with n.