Linked List Operations
In this article you will see various liked list operations like insert delete traversing also you will learn how to implement these operations on the linked list.
There are various linked list operations that allow us to perform different actions on linked lists. For example, the insertion operation adds a new element to the linked list.
in this article you will learn topics below :
Linked List Operations :
- Traversal - access each element of the linked list
- Insertion - adds a new element to the linked list
- Deletion - removes the existing elements from link list
- Search - find a node in the linked list
- Sort - sort the nodes of the linked list ascending or descending order
Also Read Our Articles on DSA :
Node Creation :
struct node
{
int data;
struct node *next;
};
struct node *head, *ptr;
ptr = (struct node *)malloc(sizeof(struct node *));
head points to the first node of the linked list
next pointer of the last node is NULL, so if the next current node is NULL, we have reached the end of the linked list.
Traverse a Linked List :
When temp is NULL, we know that we have reached the end of the linked list so we get out of the while loop.
Insertion :
Adding a number or node in linked list is called Insertion . Insertion can be performed at many positions on linked list.
we can insert a element at three positions in linked list
- At the Begining of the linked list
- At the End of the linked list
- insertion at any specific node
Deletion :
- From the Begining of the linked list
- From the End of the linked list
- Deletion at any specific node
Sort Elements of a Linked List :

