Compare mode runs two at once
Run Bubble Sort and Insertion Sort on the same input and watch which one does fewer comparisons.
| Bubble | Insertion | |
|---|---|---|
| steps | 31 / 86 | 31 / 72 |
| comparisons | 10 | 8 |
| writes | 7 | 6 |
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.
Changed
| 3.next | |
| writes | 5 |
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 SortDivide & Conquer · time O(n log n) space O(n)
Merging [4..4] and [5..5] into [4..5]
Numbered in order, from arrays and linked lists to max flow and NP-hard approximations. Pick a section to open its first algorithm.
Run Bubble Sort and Insertion Sort on the same input and watch which one does fewer comparisons.
| Bubble | Insertion | |
|---|---|---|
| steps | 31 / 86 | 31 / 72 |
| comparisons | 10 | 8 |
| writes | 7 | 6 |
Type an array, a graph or two strings, or fill one with a preset, and the tracer runs the real code on it.
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?
Best, average and worst case for all 211 algorithms in one Markdown file.
Short answers before you open it.
No. It runs in your browser: pick an algorithm and press Space. There is nothing to install.
C++, Python and pseudocode, with the running line marked in all three.
From the mihrub/Data-Structures-and-Algorithms repository. The few algorithms it does not cover have C++ written for AlgoBench.
The tracer's message appears in the input dialog, and the last trace stays on screen.
Not yet. Pick one of the 211 algorithms and give it your own input.