Skip to main content

Radix sort on 25, 57, 48, 37, ...

Short answer

Radix sort: two passes, distributing by units then tens into ten queues. Final sorted list: 12, 25, 33, 37, 48, 57, 86, 92.

Trace the sorting steps in radix sort for: 25, 57, 48, 37, 12, 92, 86, 33 showing status of all queues in each iterations.

Radix sort uses 10 queues; the maximum key is 92 (2 digits), so 2 passes are needed.

Initial list: 25, 57, 48, 37, 12, 92, 86, 33

Pass 1 (units digit)

QueueContents (front to rear)
0empty
1empty
212, 92
333
4empty
525
686
757, 37
848
9empty

After collecting: 12, 92, 33, 25, 86, 57, 37, 48

Pass 2 (tens digit)

QueueContents (front to rear)
0empty
112
225
333, 37
448
557
6, 7empty
886
992

After collecting: 12, 25, 33, 37, 48, 57, 86, 92

Answer: 12, 25, 33, 37, 48, 57, 86, 92

✓ Answer checked by Claude Opus 5.5 (high effort)

All Data Structure and Algorithm chapter 7 questions →