I am wondering what the fastest algorithm would be for this. I have 8 integers between 0 and 3000 and I need to sort them. Although there are only 8 integers, this operation w
For very small numbers of ints, bubble sort can be very fast. Bubble sort with numerical comparisons can be written with a very low overhead and for small n, the actual speed differences between O(n log n) and O(n^2) washes out.