Insertion sort is a simple sorting algorithm that works similar to the way you sort playing cards in your hands. The array is virtually split into a sorted and an unsorted part. Values from the unsorted part are picked and placed at the correct position in the sorted part.
Output:
Enter total elements: 5
Enter 5 elements: 12
36
25
14
45
After sorting :12 14 25 36 45
need an explanation for this answer? contact us directly to get an explanation for this answer