Skip to content

Sorting Algorithm Visualizer

Animate bubble merge and quicksort algorithms

Updated

What is the Sorting Algorithm Visualizer?

How it works

Examples

Bubble sort a small random array

Algorithm: Bubble Sort | Preset: Random | Size: 10 | Speed: 50
Sorted in ascending order after 45 comparisons and 28 swaps / writes, with the pseudocode line-by-line highlight tracking the inner loop.

Quick sort a reversed (worst-case) array

Algorithm: Quick Sort | Preset: Reversed | Size: 15 | Speed: 70
Sorted in ascending order after roughly 100 comparisons and 30 swaps; the pivot bar is highlighted blue throughout the partition step.

Sort a custom array of values

Algorithm: Merge Sort | Preset: Custom | Values: 17, 4, 9, 23, 2, 11 | Size: 6
Sorted: [2, 4, 9, 11, 17, 23] in 9 comparisons and 12 writes, with the active merge range highlighted at each recursion level.

Frequently asked questions