Insertion sort explained with simple example
Insertion sort is one of simplest sorting algorithm which traverse through the list, picking one item at a time and place it in its place in the final sorted list. This sorting algorithm contains (n – 1) traversal.
Pros:
1) Simple algorithm and hence efficient for small list of data.
2) No extra memory needed.
3) Good for cases when list is almost sorted (only few misplaced items).
Cons:
1) Very slow algorithm. Not good for very large set of data.