Different Sorting Algorithms in Java