DeskGyver

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