Skip to content

Insertion Sort

Insertion sort is simple and a in place replacement algorithm.

Key point is to go through the array of elements and compare it with its previous elements. If the previous elements are greater than the given element then move it to the previous position.