Insertion Sort Algorithm

It's a simple sorting algorithm that builds the final sorted array one item at a time by comparing the new item with the elements of the sorted part of the array and inserting it in the correct position.