AlgorandSIMULATION v1.0
Sequential Engines(17)
Parallel Engines

Radix Sort

sequentialRAM

A non-comparative sorting algorithm that sorts integers by grouping keys by individual digits that share the same significant position and value, typically starting from the least significant digit (LSD).

SIMULATION STEP PROGRESSStep 1 / 1
SPEED (50%)
SIZE (8)
💡 Tip: Enter integers between 1 and 99. Max size is 15.
Code Workspace
1procedure radixSort(A: list)
2 maxVal := findMax(A)
3 exp := 1
4 while maxVal / exp > 0 do
5 countingSortByDigit(A, exp)
6 exp := exp * 10
7 end while
8end procedure
9procedure countingSortByDigit(A, exp)
10 n := length(A)
11 output := array of size n
12 count := array of size 10 initialized to 0
13 for i := 0 to n - 1 do
14 digit := floor(A[i] / exp) % 10
15 count[digit] := count[digit] + 1
16 end for
17 for i := 1 to 9 do
18 count[i] := count[i] + count[i - 1]
19 end for
20 for i := n - 1 down to 0 do
21 digit := floor(A[i] / exp) % 10
22 output[count[digit] - 1] := A[i]
23 count[digit] := count[digit] - 1
24 end for
25 copy output to A
26end procedure
Currently highlights executing branch
RUNTIME COST METRICS
Comparisons0
Memory Writes0
Memory Reads0
Elements Swapped0
Computational Model:RAM (Single Core)
Theoretical Bound:O(d · (N + k))
Space Complexity:O(N + k)
Communication Cost:0 (Shared Bus)
THEORETICAL ANALYSIS & RESEARCH

Conceptual Focus: A non-comparative sorting algorithm that sorts integers by grouping keys by individual digits that share the same significant position and value, typically starting from the least significant digit (LSD).

Real-world Industrial Applications:
  • Sorting zip codes, phone numbers, or dates
  • Used on hardware architectures with parallel sorting capability
  • High-performance database indexing routines