| | | | | |

Radix Sort

void radix_sort(A,n,d)
// Pre:  A is defined in the range [0,n)
//       elements of a are numbers with d (or fewer) digits
// Post: A is sorted
{
  for (i = 1; i <= d; ++i)
    sort A with a stable sort and key = digit i
}

| | Top of Page | 8. Sorting Algorithms - 15 of 16