Java Sorting Algorithms Time Complexity