DSA Lab

Radix sort visualizer

Sort by the last digit, then the tens digit, then the hundreds, using ten buckets. Each pass keeps the order of the one before, so after the last digit all is sorted. Many whole numbers or fixed-length keys (IDs, phone numbers, dates): d passes of O(n), with no comparisons.

Radix sort: its cost, and how to use this tool

Time: best O(d · n), average O(d · n), worst O(d · n). Extra memory: O(n). Stable, not in place.

Sort a ready-made input or your own numbers. The bars are the array; the code beside them (in Python, C, C++ or Java) marks the line that just ran, and every step is explained and worked out below the bars.

See also