Implementation of various sorting algorithms in Java