Sorting Algorithm Visualizer
Watch bubble, insertion, selection, merge, and quick sort animate step-by-step on random data. Learn algorithm behavior visually.
How to use the Sorting Algorithm Visualizer
-
Choose an algorithm and set the array size.
-
Click Start to watch the sort animate.
-
Compare algorithms side by side.
Why visualize sorting?
Sorting algorithms are fundamental to computer science but hard to internalize from code alone. This visualizer animates each algorithm's process — comparisons, swaps, and partitioning — so you can see the differences in speed and strategy. Adjust speed and array size, then watch the algorithm work.
Key features
- Bubble, insertion, selection, merge, and quick sort
- Adjustable speed and array size
- Color-coded comparisons and swaps
- Step counter and time display
Frequently asked questions
Which algorithm is fastest?
For random data: Quick sort and Merge sort are O(n log n). Bubble, insertion, and selection are O(n²) — much slower on large arrays.
Can I input my own data?
Currently random data only. Custom data input is planned.
Does this run locally?
Yes — all animation and computation happens in your browser.