Interactive visualizations of classic sorting algorithms rendered on HTML5 Canvas.
Live Demo
Choose an algorithm, adjust the number of bars and animation speed, then click Sort to watch the algorithm work step-by-step. Click Shuffle to randomize the array at any time.
One of the first projects built outside of a classroom. The original was written in Processing (a Java variant designed for visual applications), and this web version recreates the same visualizations using HTML5 Canvas and JavaScript.
Six comparison-based sorting algorithms are implemented:
Each algorithm animates element comparisons and swaps in real-time, making it easy to see how different strategies traverse and reorder the data.
Above: the original Processing-based visualization.