Implementation of various sorting algorithms.