Sorting Algorithm Visualizer
Watch Bubble Sort, Selection Sort, Insertion Sort, Merge Sort, and Quick Sort race to organize colored bars. Step through one comparison at a time or race two algorithms side by side.
Frequently Asked Questions
What does this tool teach?
This tool teaches fundamental computer science concepts: how sorting algorithms work, why some are faster than others, what Big-O notation means, and the divide-and-conquer strategy. Watch each algorithm's logic step by step!
What algorithms are included?
Five classic sorting algorithms: Bubble Sort (compare neighbors), Selection Sort (find the minimum), Insertion Sort (insert in order), Merge Sort (divide and merge), and Quick Sort (partition around a pivot). Each is visualized with colored bars.
What is Race Mode?
Race Mode runs two different algorithms side by side on the same shuffled data, so you can see which one finishes first. It's the best way to understand why O(n log n) algorithms like Merge Sort and Quick Sort are so much faster than O(n²) algorithms!
What do the colors mean?
Bar heights show values (tall = big number). During sorting: yellow highlights show elements being compared, green flashes show swaps happening, blue marks the pivot in Quick Sort, and a green tint shows the already-sorted portion.
Related Tools
🎓 Learning Lab
BlockCode Data Lab
Build visual block programs to filter, sort, and transform data tables — like Scratch for data science. Upload CSV files or use built-in sample datasets.
🎓 Learning Lab
Billiard Balls & Angles
Interactive pool table simulation — learn about angles of incidence and reflection, practice bank shots and cut shots with 10 challenge scenarios, then play a full 2-player 8-ball game.
🎓 Learning Lab
Build a Bell Curve
Watch the Central Limit Theorem in action — sample from any distribution, then see the histogram of averages converge to a perfect bell curve as trials accumulate.
