1. What is the difference between Array List and Linked List ?
2. Inserting a node at the beginning of linked list
3. Insert a node after a given node in linked list
4. How to insert a node at the end of a given node? - Codzify.com Tutorials
5. Bubble Sort Algorithm with practical program in C
6. Insertion Sort Algorithm with practical program in C
7. Merge Sort Algorithm with practical program in C
8. BFS and DFS in Data Structure | Inorder, Preorder and Postorder Traversal with practical example.
9. Kruskals Algorithm with practical example
10. How to calculate the complexity of Algorithms?
11. How to insert a new node after a given node in a linked list? - Codzify.com Tutorials
12. How to insert a new node after a given node in a linked list? - Codzify.com

**Article by:** Manish Methani

**Last Updated:** October 10, 2021 at 8:04am IST

Insertion sort is a simple sorting algorithm that builds the final sorted array (or list) one item at a time. It is much less efficient on large lists than more advanced algorithms such as quicksort, heapsort, or merge sort.

Suppose we have an array in unsorted order (4,6,3,1)

**1) In the first step, ** 6 will be compared with 4. Since 4 < 6 , no insertion takes place.

**2) In the second step, ** 3 will be compared with 6. Since 3 < 6 , it must be on the left of 6 . Now on left of 6 , 4 is present so 3 will be compared with 4. Since 3 < 4, 3 must be on the left of 4. As there are no more elements present to the left of 4 , 3 will be inserted before 4.

Array will look loke this => 3,4,6,1.

**3) In the third step, ** 1 will be compared with 6. Since 1 < 6 , it must be on the left of 6 . Now on left of 6 , 4 is present so 1 will be compared with 4. Since 1 < 4, 1 must be on the left of 4. Now on left of 4 , 3 is present so 1 will be compared with 3. Since 1 < 3, 1 must be on the left of 3. As there are no more elements present to the left of 3 , 1 will be inserted before 3.

Array will look loke this => 1,3,4,6.

This basic Insertion Sort in C programming explains the concept of how to sort the elements using Insertion sort in Data Structures.

#include #include #include #include #include void insertionSort(int N, int arr[]) { int i,j; int value; for(i=1;i=0 && value