Brain Dump

Radix Sort

Tags
algorithm comp-sci

Is a linear time sorting algorithm which sorts a series of numbers by sorting based on individual digits. When using a stable sorting algorithm to sort on [see page 19, individual digits] you can guarantee the output is properly sorted.

def radix_sort(arr):
    d = max(len(str(i)) for i in arr)
    for i in range(0, d):
	stable_sort(arr, i)
Code Snippet 1: Implementation of radix sort to sort each digit using some stable sorting algorithm. alg:radix_sort