Program to Delete a Linked List

Write a program to delete a linked list. Given a linked list, we have to write a code to delete a linked list.

To delete a complete linked list, traverse all the nodes of a linked list and delete one by one.

Print Middle Element of a Linked List

How to Delete a Linked List

To delete a node one by one maintain two pointers.  The first pointer points to head and the second pointer keeps the reference to next node. So when a node is free, you can assign the reference of next node using the second pointer.

Insertion Sort Program in C

Insertion sort program in C. Given an unsorted array, write a c program to sort an array using insertion sort.

In this tutorial, we are going to discuss following points.

i) What is insertion sort.

ii) How it’s different from Selection sort and Bubble sort.

iii) Insertion sort algorithm and it’s implementation using C program.

I have already discussed following sorting algorithms in my previous tutorials.

Bubble Sort Program in Java

Selection Sort Program in C