Add the implementation of the sort algorithms.