Category Archives: Linked Lists

Linked List problems

Circular Queue | Set 2 (Circular Linked List Implementation)

Prerequisite – Circular Singly Linked List We have discussed basics and how to implement circular queue using array in set 1. Circular Queue | Set 1 (Introduction and Array Implementation) In this post another method of circular queue implementation is discussed, using Circular Singly Linked List. Operations on Circular Queue: Front:Get the front item from… Read More »

Doubly Circular Linked List | Set 2 (Deletion)

We have discussed doubly circular linked list introduction and its insertion. Let us formulate the problem statement to understand the deletion process. Given a ‘key’, delete the first occurrence of this key in circular doubly linked list. Algorithm Case 1: Empty List(start = NULL) If the list is empty, simply return. Case 2:List initially contain… Read More »

Doubly Circular Linked List | Set 1 (Introduction and Insertion)

Prerequisite: Doubly Linked list, Circular Linked List Circular Doubly Linked List has properties of both doubly linked list and circular linked list in which two consecutive elements are linked or connected by previous and next pointer and the last node points to first node by next pointer and also the first node points to last… Read More »

Deletion from a Circular Linked List

We have already discussed about circular linked list and traversal in a circular linked list in the below articles: Introduction to circular linked list Traversal in a circular linked list In this article we will learn about deleting a node from a cicular linked list. Consider the linked list as shown below: We will be… Read More »

How to insert elements in C++ STL List ?

List has been discussed in many articles, but the sole purpose of this article is to cover all types of insertions that are possible to be carried in a list container and to give a detailed insight on the insertion operations. List and its many functions are defined under the header file “list” . Various… Read More »

Circular Singly Linked List | Insertion

We have discussed Singly and Circular Linked List in the following post: Singly Linked List Circular Linked List Why Circular? In a singly linked list, for accessing any node of linked list, we start traversing from the first node. If we are at any node in the middle of the list, then it is not… Read More »

Adding two polynomials using Linked List

Given two polynomial numbers represented by a linked list. Write a function that add these lists means add the coefficients who have same variable powers. Example: Input: 1st number = 5x^2 + 4x^1 + 2x^0 2nd number = 5x^1 + 5x^0 Output: 5x^2 + 9x^1 + 7x^0 Input: 1st number = 5x^3 + 4x^2 +… Read More »