About this visualizer
What it is
A learning assistant for the recursion part of DSA. Pick a built-in example or write your own recursive Python function, give it an initial call, and watch the run happen: frames push onto and pop off the call stack while the call tree draws itself node by node, each call labelled with its arguments and, once it finishes, its return value. Repeated calls with the same arguments — the naive fibonacci trap — are flagged as recomputed work.
When you ask, the analysis panel applies the course's recurrence-relation method (base case cost, T(n) = T(smaller) + c, expansion, closed form, Big-O) to the code, cross-checked against what the trace actually did, and adds a space analysis from the deepest the stack really got.
What it is not
- Not a debugger: it visualizes calls and returns, not line-by-line variable state.
- Not a proof machine: the analysis assists your DSA reasoning and defers to your instructor when a pattern is not recognized.
- Not a general Python runner: only function definitions and a single initial call are traced, with safety limits (below).
Where the trace comes from
Your Python code runs entirely in your browser inside a sandboxed Web Worker (Pyodide, Python compiled to WebAssembly). Before running, the code is checked against an allowlist: no imports, no file or network access, no eval-style built-ins. Every function definition is wrapped with a tracing decorator, the initial call is executed, and the recorded calls and returns become the replay you see. Runs are limited to 500 trace events and 100 stack frames by default — if your input needs more, the app asks before raising the limit, so a runaway recursion cannot freeze your browser.
Privacy and security
- Your Python code is traced and analyzed locally in your browser. It is never sent to a server.
- No login is required and no database is used.
- The editor (Monaco) and the Python runtime (Pyodide) load from the jsdelivr CDN; that is the only network traffic the app makes.
- Still, treat it like any web tool: do not paste private, sensitive, or graded-solution code you are not allowed to share.
Family
Companion to the DSA Time Complexity Playground, which owns the full 5-step Big-O analysis and in-browser benchmarking; the two share their styling and analysis rules and may merge into one app later. The visualizer is the web successor of the instructor's desktop Recursive Call Tree Drawer.