Algorithm visualizer for real code

Step through 211 algorithms and data structures as they execute: the structure being built, the live line of C++, Python or pseudocode, and every changed variable on one timeline.

The real code, traced step by step

Pick an algorithm and press Space. The drawing, the underlined line and a sentence saying what the step did move together. Only the algorithm is traced: reading the input and printing the result happen off screen, and the last step says what came out.

Step through Merge Sort

Tools beside every trace. Compare, change the input, check yourself, export.

Compare mode runs two at once

Run Bubble Sort and Insertion Sort on the same input and watch which one does fewer comparisons.

BubbleInsertion
steps31 / 8631 / 72
comparisons108
writes76

Custom input runs your own data

Type an array, a graph or two strings, or fill one with a preset, and the tracer runs the real code on it.

RandomReversedSortedNearly sorted
[60, 50, 40, 30, 20, 10]

The quiz marks every answer

Questions on complexity, category and the next step of the algorithm, marked with a tick or a cross.

How much extra space does Merge Sort use?

  1. O(1)
  2. O(n)

The cheat sheet exports to Markdown

Best, average and worst case for all 211 algorithms in one Markdown file.

| # | Algorithm | Average | |------|------------|------------| | 10.1 | Quick Sort | O(n log n) | | 10.2 | Merge Sort | O(n log n) | | 12.1 | LCS | O(m·n) |

Questions

Short answers before you open it.

Do I need an account?

No. It runs in your browser: pick an algorithm and press Space. There is nothing to install.

Which languages does it show?

C++, Python and pseudocode, with the running line marked in all three.

Where does the C++ come from?

From the mihrub/Data-Structures-and-Algorithms repository. The few algorithms it does not cover have C++ written for AlgoBench.

What if my input breaks the algorithm?

The tracer's message appears in the input dialog, and the last trace stays on screen.

Can I trace my own code?

Not yet. Pick one of the 211 algorithms and give it your own input.