Basically, insertion sort, is making element sorted in certain way using one element at a time it bit slow process for long array but applicable for small array’s

Source: Rohit Kanyal.

We all familiar with one of famous example is the card playing game.

When you get cards you have to arranged them in such way you can take next decision without losing any advantage in game similar thing happen to arrange element in any kind of data in system.

Insertion sort

Insertion sort is the simple sorting algorithm that virtually splits the given array into sorted and unsorted parts, then the values from the unsorted parts are picked and placed at the correct position in the sorted part.

One more real-world example of insertion sort is how tailors arrange shirts in a cupboard, they always keep them in sorted order of size and thus insert new shirts at the right position very quickly by moving other shirts forward to keep the right place for a new shirt.

Untitled

Simple Programmer for Insertion.