Implementation of all sorting algorithms