Implement insertion-sort algorithm.