Find the highest and lowest elements of the set
•
Count the different elements in the array. (E.g. Set [4,4,4,1,1] would give
three 4's and two 1's)
•
Accumulate the counts. (E.g. starting from the first element in the new set of
counts, add the current element to the previous.)
•
Fill the destination array from backwards: put each element to its count
position.