In Java’s standard library, is there a method that would allow one to sort an ArrayList in place, i.e. using O(1) extra storage?
Collections.sort(List<T>) does not fulfil this requirement since it
dumps the specified list into an array, sorts the array, and iterates over the list resetting each element from the corresponding position in the array.
If there’s nothing in the standard library, what third-party libraries can be used to do this?
You can extract the underlying array (e.g. reflection) and perform a Arrays.sort(array, 0, list.size()) on it.
Java 7 does not copy the array in Arrays.sort() before sorting the array. In Java 6 it does which means that Collections.sort() in Java 6 actually copies the underlying array TWICE to perform the sort.