Skip to content

Watch the algorithm run,
one step at a time.

26 algorithms across 10 patterns, in the browser. Put in your own array, string or graph, step forward and back, and watch what the code is holding at every moment. Free to use.

Free to start: 100 AI credits when you sign up and 100 every month. Practice runs never cost credits.

A dry run on paper loses the state.

The thing students get wrong is rarely the idea. It is what the variables hold on step nine.

You can follow merge sort in your head for six elements and lose the thread at twelve. You can read the two-pointer trick and still not see why moving the shorter line is the only move that can help. Both gaps are about state: what is in the window, the stack, the table, the queue, right now.

The visualiser holds that state in front of you and moves one step at a time. The array, the pointers, the recursion tree, the DP table and the code line being executed all move together, forward or back, at your pace.

Put your own input in. A sorted array, a nearly sorted one, an array with duplicates, an empty one. Watching the same algorithm on three inputs is how the edge case stops being a surprise in an interview.

The 26 algorithms, by pattern.

Each pattern carries the idea in one line, then the algorithms that live inside it.

  • Arrays & hashingTrade memory for time: remember what you have seen.Two sum, Subarray sum equals k
  • Two pointersTwo indexes walk towards each other, each step ruling something out.Pair sum in a sorted array, Valid palindrome, Container with most water
  • Sliding windowGrow the right edge, shrink the left, never look back.Max sum of k in a row, Longest substring without repeats
  • Binary searchHalve the search space with every check.Binary search, First true (lower bound)
  • StackThe most recent unfinished thing is the one you need.Valid parentheses, Next greater element
  • SortingHow order is built, one comparison at a time.Bubble sort, Insertion sort, Merge sort, Quick sort
  • Recursion & DPSolve smaller copies, then stop solving them twice.Fibonacci: recursion to DP, 0/1 knapsack, Longest common subsequence
  • TreesEvery node is the root of a smaller problem.Tree traversals, BST insert and search
  • HeapAlways know the smallest, in log n per change.Binary heap push and pop
  • GraphsExplore in layers, or go deep, and never visit twice.BFS and DFS, BFS shortest path on a grid, Topological sort, Union-find, Dijkstra

What you can do while it runs.

Built for studying, not for a demo video.

Step, back, replay

Move one step at a time in either direction, or let it play. The step you did not understand is the one you can sit on.

Your input, not ours

Type the array, string or graph you want. The same algorithm on your own tricky case is worth ten on a clean one.

The code, in step

The line being executed is highlighted as the picture changes, so the drawing and the code never drift apart.

Share the exact step

A link carries the algorithm, your input and the step number, so you can send a friend the moment you are stuck on.

Questions about algorithm visualiser.

Still not sure? Start free, or a mentor answers on a call.

Start free
What is a DSA visualiser?

A tool that draws a data structure while an algorithm runs on it, so you can see the array, pointers, stack, tree or table change at each step instead of imagining them.

Which algorithms can I watch?

26 of them: sorting (bubble, insertion, merge, quick), binary search and lower bound, two pointers, sliding window, stacks, tree traversals and BST, heaps, BFS, DFS, grid shortest path, topological sort, union-find, Dijkstra, and DP including knapsack and longest common subsequence.

Can I use my own input?

Yes. Type your own array, string or graph and the algorithm runs on that, including the edge cases you want to test.

Is the visualiser free?

Yes, and watching costs no credits. The app is free to start.

How does it help in an interview?

It builds the picture you fall back on when you are nervous. Students who can see the window or the recursion tree explain their approach faster, and explaining is half the round.

Not sure where to start? A mentor calls you, free.

Tell us who you are. On the call we help you pick the right batch.

  1. 1We check your level, from never coded to ready for interviews.
  2. 2We suggest online or campus, and a batch timing that fits your day.
  3. 3You decide. No pressure, no payment on the call.

Get a free callback

I am a
I want to learn

We only use your number to call you about CodeStory.