Implementation of the Insertion Sort algorithm.