Side-by-side comparison of 4 sorting algorithms visualized as bar charts.
Algorithms
- Bubble Sort — Repeatedly swaps adjacent elements. Simple but slow. O(n^2)
- Selection Sort — Finds the minimum and places it at the front. O(n^2)
- Insertion Sort — Shifts elements to insert each one in order. Adaptive, fast on nearly
sorted data. O(n^2)
- Quick Sort — Partitions around a pivot recursively. Fast average case. O(n log n)
How it runs
- 80 random elements, same initial array for all four algorithms
- Each algorithm runs solo first, then all four run simultaneously
- Bars turn yellow during comparison, green when fully sorted
- Step count displayed in real-time to compare efficiency
Multiple rounds with different random arrays to show consistent performance characteristics.
Built with Rust and Bevy 0.18.
#sorting #algorithm #bubblesort #quicksort #insertionsort #selectionsort #visualization
#rust #bevy #programming
Download
0 formats
No download links available.
Bubble Sort vs Selection Sort vs Insertion Sort vs Quick Sort — Sorting Algorithm Visualization | NatokHD