Back to blog
Mar 17, 2024
1 min read

Algorithms: Insertion Sort

How does insertion sort algorithm work

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.