theGnaN Tech Hub
Algorithm Category · Sorting

Sorting Algorithms Visualized.

Sorting is the cornerstone of algorithmic thinking. Observe how different algorithmic strategies — selection, partitioning, divide-and-conquer, and digit bucketing — manipulate memory to arrange items in order.

The Catalog

8 Sorting Algorithms

1 Available · 7 In Development
#1Interactive

Selection Sort

Finds minimum in unsorted suffix and swaps into prefix position. Minimal writes, O(n²) comparisons.

Time (Avg):O(n²)
Time (Worst):O(n²)
Space:O(1)
Stable:No
#2Upcoming

Bubble Sort

Adjacent swaps bubble largest values to the end.

Time (Avg):O(n²)
Time (Worst):O(n²)
Space:O(1)
Stable:Yes
#3Upcoming

Insertion Sort

Efficient for small or nearly sorted collections.

Time (Avg):O(n²)
Time (Worst):O(n²)
Space:O(1)
Stable:Yes
#4Upcoming

Merge Sort

Divide-and-conquer with guaranteed O(n log n) runtime.

Time (Avg):O(n log n)
Time (Worst):O(n log n)
Space:O(n)
Stable:Yes
#5Upcoming

Quick Sort

In-place partitioning with high cache locality.

Time (Avg):O(n log n)
Time (Worst):O(n²)
Space:O(log n)
Stable:No
#6Upcoming

Heap Sort

Priority queue mechanics with O(1) auxiliary space.

Time (Avg):O(n log n)
Time (Worst):O(n log n)
Space:O(1)
Stable:No
#7Upcoming

Counting Sort

Linear-time non-comparison sorting for discrete integer ranges.

Time (Avg):O(n + k)
Time (Worst):O(n + k)
Space:O(k)
Stable:Yes
#8Upcoming

Radix Sort

Digit-by-digit distribution sort.

Time (Avg):O(d · (n + b))
Time (Worst):O(d · (n + b))
Space:O(n + b)
Stable:Yes
Reference Guide

Comparative Complexity Matrix

Asymptotic bounds across best, average, and worst execution cases along with auxiliary space guarantees.

AlgorithmBest TimeAverage TimeWorst TimeAux SpaceStableIn-PlaceAction
Selection SortLIVE
O(n²)O(n²)O(n²)O(1)NoYesOpen
Bubble Sort
O(n)O(n²)O(n²)O(1)YesYesSoon
Insertion Sort
O(n)O(n²)O(n²)O(1)YesYesSoon
Merge Sort
O(n log n)O(n log n)O(n log n)O(n)YesNoSoon
Quick Sort
O(n log n)O(n log n)O(n²)O(log n)NoYesSoon
Heap Sort
O(n log n)O(n log n)O(n log n)O(1)NoYesSoon
Counting Sort
O(n + k)O(n + k)O(n + k)O(k)YesNoSoon
Radix Sort
O(d · (n + b))O(d · (n + b))O(d · (n + b))O(n + b)YesNoSoon