CPKit
v1.6.1

Radix Sort

SortingMedium

Process elements digit-by-digit to achieve linear O(N) sort speeds.

Alt+Shift+R

Configuration Panel

Digit-by-Digit Places Visualizer

170
0
45
1
75
2
90
3
802
4
24
5
2
6
66
7
Step: 1 / 1

Time Complexity

O(D * (N + B)) where D is digits count, B is base base (10)

Space Complexity

O(N + B) auxiliary space buffers
Conceptual Overview

Radix Sort processes integers digit-by-digit, starting from the least significant digit (LSD) to the most significant digit (MSD), using a stable sub-sorting algorithm like Counting Sort.

Algorithm Idea

Perform counting sort on the array for each digit place (ones, tens, hundreds...). Preserving stability ensures elements sort correctly across preceding digits.

Stable Sorting

Stable (requires a stable sub-sorting routine)

In-place Memory

Out-of-place (requires auxiliary output copy lists)

Source: CP-Algorithms search & sorting reference