Paste JavaScript, TypeScript, or Python
Use ordinary code in any of the three languages — switching rewrites the solution automatically. The visualizer observes arrays, pointers, maps, queues, graph nodes, trees, and recursion frames.
Getting started
DSA Lab helps you inspect the state that interview questions hide: moving pointers, changing maps, search bounds, tree swaps, graph visits, and recursive calls — then tells you whether your solution actually passes.
Use ordinary code in any of the three languages — switching rewrites the solution automatically. The visualizer observes arrays, pointers, maps, queues, graph nodes, trees, and recursion frames.
Use the Input tab for the data your code expects — { "array": [4, 1, 3] } or { "graph": { "A": ["B"] } } — with one-click edge cases for common scenarios.
Hit Run, then play, pause, jump through states, or drag the timeline. Space plays, ←/→ step, Home/End jump — and the active code line follows along.
See it in action
Five live demos, one per family — sorting, searching, trees, hashing, and recursion. Each one plays the real visualizer: bubble sort swaps values into place, binary search narrows its window, Invert Binary Tree mirrors a tree, Two Sum builds a hash map, and fibonacci grows and unwinds its recursive call stack.
Copy the input array
lo = 0, hi = 6 — the search space is the whole array
Start at the root — invertTree(4)
seen = {} — no numbers remembered yet
Start the trace: call fib(5)
Built for interview prep
The same engine that traces your pasted code powers a full practice curriculum — verified answers, quizzes, and comparisons so you know you're getting it right.
Every question from LeetCode's Top Interview 150, grouped by topic with difficulty and tags. Each one opens in the visualizer with its solution, input, and answer ready to run.
Arrays → Two pointers → Sliding window → Recursion → Trees → Graphs → DP. Checkpoint quizzes along the way keep your practice structured, not scattered.
Every traceable question ships with its known answer, so your run is graded automatically — even your own edited code — with a clear ✅ Pass or ❌ Fail in the Result tab.
Toggle Compare to run brute force side-by-side with the optimal solution, and watch the ⚖ comparisons, 🔄 swaps, and ✍ writes counters diverge as you step.
A 30-second guided walkthrough of the visualizer — every panel, the operation counters, language switching, and the compare mode, with a live trace running underneath.
Start with the included presets, or paste a single algorithm function in JavaScript, TypeScript, or Python and keep the input serializable as JSON. The expected answer is pre-filled, so your run is graded the moment it finishes.