Sorting Algorithms

Explore and compare 18+ sorting algorithms with interactive visualizations.

Interactive Visualizer

Watch algorithms sort in real-time with step-by-step animations

Featured Algorithms

Quick Comparison

AlgorithmBestAverageWorstSpaceStable
Bubble SortO(n)O(n²)O(n²)O(1)
Selection SortO(n²)O(n²)O(n²)O(1)
Insertion SortO(n)O(n²)O(n²)O(1)
Merge SortO(n log n)O(n log n)O(n log n)O(n)
Quick SortO(n log n)O(n log n)O(n²)O(log n)
Heap SortO(n log n)O(n log n)O(n log n)O(1)
⚡ Performance
Quick Sort and Merge Sort are the most commonly used general-purpose algorithms.
🎯 Stability
Stable sorts maintain relative order of equal elements - important for multi-key sorting.
💾 Memory
In-place algorithms like Quick Sort and Heap Sort use O(1) or O(log n) extra space.