[ QUOTE ]
Aside: If you don't have an upper bound on the size of your numbers, the (provably) fastest sorting algorithms are O(n log n). For the reasons above, most sorting algorithms that are built into software use quicksort (O(n log n)) when n > 7, and something like bubble sort or insertion sort (O(n^2)) when n <= 7. Even though the latter algorithms are slower asymptotically, for small enough instances, they are pretty fast.
[/ QUOTE ]
For very small values of n, then the best choice is usually to use a
Sorting Network with hard-coded compare and swap operations to reduce overhead to a minimum.
Juk [img]/images/graemlins/smile.gif[/img]