Use a sorting algorithm. There are a bewildering number of
sorting algorithms, both stable and unstable. To sort numbers, an
unstable sort suffices. The algorithm you use will depend on how
many numbers need to be sorted (a small or a large set), however a
hybrid algorithm (a combination of two or more algorithms) can
cater for both. Introsort (unstable) and timsort (stable) are the
two most common hybrid sorting algorithms.