Sorting In Java Without Sort Function Complexity