Recursion Tree

Visualize recursive function call trees for Fibonacci, factorial, and more.

Category: Algorithms · v1.0.0
Total Calls
0
Max Depth
0
Result

About This Simulator

Watch how recursive functions unfold into a tree of calls. This simulator traces each function call, building a visual tree that shows the call stack depth, return values, and how many redundant computations happen. Great for understanding why memoization matters and how recursion depth affects performance.

How It Works

  1. Choose a recursive function from the dropdown (Fibonacci, Factorial, etc.)
  2. Enter an input value (keep it small for Fibonacci — grows fast!)
  3. Click Build Tree to watch the call tree expand
  4. Hover over nodes to see their return values
  5. Red-highlighted nodes show duplicate computations
  6. Compare call counts to see exponential vs linear growth