for i = 0 to
numDigits(data.max)
buckets =
new Array(10)
for x = 0 to
length(data)
num =
getNum(data[j], i)
if num !==
undefined
buckets[num].push(data[j])
data =
mergeBuckets()
---------------------
| SHORT EXPLANATION |
---------------------
1. Create ten empty arrays (the buckets which will later
hold the numbers)
2. For each element in the list, move it into the correct
bucket.
3. For each bucket (starting from 0), restore elements to
the list.
4. Repeat steps 2 and 3 until all digits have been
seen.