Complete insertion and selection sort.