Interactive counting sort. Tally each value, prefix-sum the tallies into end positions, then place each value at its slot.
Counting sort · n=9, k=9
waiting
reading
active count
placed
Input list
Count array
(how many of each value)
Output (final sorted positions)
Step 0 / 0
Count
Press Play.
Three phases: count → prefix-sum → place each value at its slot.
Back
Play
Step
Shuffle
Speed
operations
0
placed
0
phase
Count
progress
0%
count[v]++ for each value v
make running totals:
count[v] += count[v-1]
for each v from right to left:
pos = count[v] - 1
output[pos] = v; count[v]--
timeline
0 / 0
←
→
space
walk steps