Data Structure : Circular Linked List

A circular linked list is basically a linear linked list that may be singly or doubly. The only difference is that there is no any NULL value terminating the list. In fact in the list every node points to the next node and last node points to the first node, thus forming a circle. Since … Read more

C program to reverse a doubly linked list

Write a C program to create a doubly linked list and reverse the linked list. How to reverse the doubly linked list in C programming. Algorithm to reverse a doubly linked list.

Doubly Linked List
Doubly Linked List
Doubly Linked List Reversed
Doubly Linked List Reversed

Read more

C program to delete a node from doubly linked list

Write a C program to create a doubly linked list and delete a node from beginning, end or at any position of the linked list. How to delete a node from beginning of a doubly linked list. How to delete a node from end of a doubly linked list. How to delete a node from any position of a doubly linked list in C. Algorithm to delete a node from doubly linked list.

Doubly linked list deletion of a node

Read more

C program to insert node in a Doubly linked list

Write a C program to create a doubly linked list and insert a new node in beginning, end or at any position in the list. How to insert a new node at beginning of a Doubly linked list. How to insert a new node at the end of a doubly linked list. How to insert a new node at any position of a doubly linked list in C. Algorithm to insert node in a doubly linked list.

Insertion of new node in a doubly linked list

Read more

C program to create and traverse Doubly Linked List

Write a C program to implement Doubly linked list data structure. Write a C program to create a doubly linked list and display all nodes of the created list. How to create and display a doubly linked list in C. Algorithm to create and traverse doubly linked list.

Doubly Linked List
Doubly Linked List

Read more

C program to swap two nodes in a linked list

How to swap two nodes in a linked list is a popular problem in data structure. In this post I will explain how to swap two nodes in a linked list. I will explain to swap two nodes without swapping data in a linked list.

Write a C program to create a linked list and accept two node position from user. The program should swap two nodes in linked list without swapping their data.

Read more

C program to search an element in linked list

Search is one of the most common operation on performed any data structure. In this post I will explain how to search an element in linked list (iterative and recursive) using C program. I will explain both ways to search, how to search an element in linked list using loop and recursion.

Write a C program to create a function to search an element in linked list. If element exists in the linked list then, it should return its index otherwise -1.

Read more