Implementation of common sorting algorithms