Dynamic Programming Recurrence Relation Visualization

f(h) = f(h-1)² + 2 × f(h-1) × f(h-2)
Step 1 of 5

This visualization demonstrates how we can build trees of height h using combinations of smaller subtrees.

The formula f(h) = f(h-1)² + 2 × f(h-1) × f(h-2) counts the number of distinct binary trees of height h.

Let's understand how this recurrence relation works through animation.