Contents    Page-10    Prev    Next    Page+10    Index   

Radix Sort

Radix sort is an old method that is worth knowing because it can be used as an external sort for data sets that are too large to fit in memory.

We will assume that we are sorting integers in decimal notation; in modern practice, groups of bits would be more sensible.

The idea of radix sort is to sort the input into bins based on the lowest digit; then combine the bins in order and sort on the next-highest digit, and so forth.

The bins can be mostly on external storage media, so that the size of the data to be sorted can exceed the size of memory.

The sorting process can also be parallelized.

The performance of radix sort is O(n · k) where k is the key length. It makes sense to think of k as being approximately log(n), but if there many items for each key, radix sort would be more efficient than O(n · log(n)).

Radix sort is stable.