Skip to main content

Radix Sort

Sorts integers digit by digit using a stable sub-sort at each place value.

Interactive Visualization

Loading visualization…

Usage

import { radixSort } from 'athro';

const arr = [170, 45, 75, 90, 802, 24, 2, 66];
radixSort(arr);

Time Complexity

CaseTime ComplexityDescription
BestO(nk)k is the number of digits
AverageO(nk)One pass per digit place
WorstO(nk)Fixed number of digit passes