implemented inplace quick sort (borrowed from JDK7), + "choice" sort that chooses quick or heap depending on the heuristics analysis.