Category Archives: Data Structures

Queue implementation using linked list, enqueue and dequeue in C

Write a C program to implement queue data structure using linked list. In this post I will explain queue implementation using linked list in C language.

In previous post, I explained about queue implementation using array. Here, I will explain how to implement a basic queue using linked list in C programming. Along with I will explain how to perform enqueue and dequeue operations on Queue in C language.

Continue reading Queue implementation using linked list, enqueue and dequeue in C

Queue implementation using array, enqueue and dequeue in C

Write a C program to implement queue, enqueue and dequeue operations using array. In this post I will explain queue implementation using array in C programming. We will learn how to implement queue data structure using array in C language. And later we will learn to implement basic queue operations enqueue and dequeue.

Continue reading Queue implementation using array, enqueue and dequeue in C

Stack implementation using linked list, push, pop and display in C

Write a C program to implement stack data structure using linked list with push and pop operation. In this post I will explain stack implementation using linked list in C language.

Continue reading Stack implementation using linked list, push, pop and display in C

C program to search an element in Circular Linked List

Quick links

Write a C program to create a Circular Linked List of n nodes and search an element in Circular Linked List. How to search an element by key in Circular Linked List.

In my previous posts, I have explained how to perform search on singly linked list. In this example I will explain you how to perform search operation on Circular Linked List.

Continue reading C program to search an element in Circular Linked List

C program to delete element from circular linked list

Write a C program to delete element from circular linked list by key. In this article I will explain how to delete by key element from circular linked list. I will explain logic and program to delete element from circular linked list by key.

Continue reading C program to delete element from circular linked list

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.

Continue reading C program to swap two nodes in a linked list

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.

Continue reading C program to search an element in linked list