Sorting In Java Time Complexity