If you've prepared for coding interviews, you've probably done this before.
You write a recursive function, grab a notebook, and start drawing the recursion tree by hand. Then you sketch the call stack beside it. A few arrows later you're trying to figure out which function call is returning and which one is still waiting.
I did this for almost every recursion problem I solved.
It worked, but it wasn't exactly fun.
The problem
Recursion is one of those topics that looks simple until you have to trace it.
The code is usually short.
The execution isn't.
Once there are multiple recursive calls, different local variables, return values flowing back up, and maybe memoization on top of that, everything becomes much harder to follow.
During interview preparation I looked for tools that could help visualize recursion.
I found several.
Some showed a recursion tree.
Some animated a fixed example.
Some displayed the call stack.
But I couldn't find one that combined everything in one place while letting me run my own code.
That became my weekend project.
Building RecurSee
I built RecurSee, an interactive recursion visualizer that lets you write recursive code and watch it execute step by step.
It currently supports:
Java
Python
JavaScript
Instead of reading static code and mentally simulating execution, you can watch:
the recursion tree grow
the call stack change
variables update
base cases execute
return values propagate back up
execution move one step at a time using a timeline
The hardest part
I expected rendering the recursion tree to be the difficult part.
It wasn't.
Keeping everything synchronized was.
When execution moves to the next step, the highlighted node, call stack, variables, and return values all need to update together.
If even one of them is out of sync, the visualization becomes confusing instead of useful.
Variable tracking was another unexpected challenge. Small UI decisions made a much bigger difference than I anticipated.
Visualizing memoization
One feature I wanted from the beginning was showing where memoization actually helps.
When people first learn dynamic programming, they're often told:
"Store previous results."
That's easy to say.
It's much easier to understand when you can actually see the same subproblem appearing multiple times in the recursion tree.
Watching repeated branches appear makes the motivation behind memoization much more obvious than reading about it.
Stepping through execution
One feature I use the most is the timeline.
Instead of replaying the entire execution, I can move forward or backward one step at a time and inspect exactly what's happening.
That turned out to be much more useful than I expected, especially while debugging.
Current limitations
Very large inputs create very large recursion trees.
That's expected, and there are practical limits to how much can be displayed while keeping the visualization responsive.
For learning recursion, debugging recursive functions, and interview preparation though, it has worked well.
Final thoughts
I built this primarily because I wanted it myself.
I wanted a tool that showed what the runtime is actually doing instead of forcing me to imagine it.
If you're learning recursion, preparing for coding interviews, or teaching recursive algorithms, I'd love to know what features you'd find useful.
You can check it out at Recursee if you're curious.
I'm also open to feedback there's still plenty I'd like to improve.



Top comments (0)