I have an array of values which is almost, but not quite sorted, with a few values displaced (say, 50 in 100000). How to sort it most efficiently? (performance is absolutely
Actually, the Wikipedia contains a Java implementation of smoothsort. You can find it here:
http://en.wikipedia.org/wiki/Smoothsort.