One element from the array is selected and is compared to the one side
of the array and inserted to the proper position while shifting
the rest of the elements accordingly.
Insertion algorithm selects one element from start (position 2nd, C array index =1).
It is saved to a temporary variable.
Then it is compared to the left side elements one by one.
If the element is bigger then the selected element, it is shifted to right.
A hole is created while this shifting. Then this process is repeated till index reaches to first element.
Element is not moved when value is less than the selected element.
The hole is not shifted in this case.
Now finally the selected element (from the temporary variable) is moved to hole.
Now this element reached to its proper position.
After this the next position or array index 2 is selected. Then we repeat the same process.
Gradually all the left side elements are moved and becomes sorted.
This entire process repeats till selection of
array position goes to max (count-1).
Finally entire array is sorted and selected element is
inserted to its proper position.