Insertion Selectio
Factor Merge Sort Radix Sort Quicksort
Sort n Sort
Best: O(n) All Best/Avg/ Best/Avg/ Best/Avg:
Time
Avg/Worst: cases: Worst: O(n Worst: O(d·n) O(n log n)
Complexity
O(n²) O(n²) log n) (d = # digits) Worst: O(n²)
O(n + k) (k = O(log n)
Space O(n) (due to
O(1) O(1) range of (stack
Complexity merging)
digits) recursion)
No Efficient
Efficient for comparisons (good pivot
Compariso Always Many
small/ordere (non- = fewer
ns O(n²/2) comparisons
dn comparative comparisons
sort) )
Shifts Exactly Moves entire
Swaps/ Bucketing (no Swaps via
elements (n - 1) halves when
Moves swaps) partitioning
(few swaps) swaps merging
❌ No (unless
Stable? ✅ Yes ❌ No ✅ Yes ✅ Yes
modified)
❌ No (uses
In-Place? ✅ Yes ✅ Yes extra ❌ No ✅ Yes
memory)
Very General-
Large
Nearly small Large data purpose,
Best Use datasets
sorted or data, with limited fast average
Case requiring
small arrays simple digit range performanc
stability
logic e
❌ Very ✅ If digit ✅ Great if
Handles ❌ Slow for ✅ Excellent
slow for range is not pivot is
Large n? large n choice
large n too large chosen well
Handles
✅ Few ❌ Many ✅ No swaps at ❌ Can be
Expensive ✅ Moderate
swaps swaps all costly
Swaps?