Insertion Sort Algorithm
Apr 8, 2021
Insertion sort is one of the fundamental sorting algorithms in the field of computer science. It is not as efficient as other sorting algorithms like quicksort, merge sort, or heapsort but it has its own advantages.

Advantages of insertion sort:
- Easy to understand and to implement.
- It is stable, in other words, the algorithm wouldn’t swap with equal value pair.
- It is in-place, in other words, the memory required by the algorithm wouldn’t be changed.
Python code implementation: