[5886 views]
Insertion sort relies on the concept that one element from the input elements is consumed in every iteration to seek out its correct position i.e, the position to which it belongs in a sorted array.
In an Insertion sort, the first element in the array is considered as sorted. In an insertion sort, each element in the array is checked with the previous elements, which results in a growing sorted output array. With every iteration, the insertion sorting algorithm removes one element at a time and finds it's appropriate location within the sorted array and inserts it there in the sorted list. The iteration continues until the whole list is sorted.
For Insertion Algorithm, you can refer our previous post Algorithm for Insertion Sort