Given a doubly linked list ‘L’ and an array ‘refArr’ of references to the nodes of the doubly linked list ‘L’. Array ‘refArr’ does not… Read More

# Category Archives: Linked List

Given a linked list. The task is to segregate its even and odd position nodes in such a way that odd position nodes appear before… Read More

Given a singly linked list, find middle of the linked list. Given a singly linked list, find middle of the linked list. For example, if… Read More

Given a binary tree, flatten it into linked list in-place. Usage of auxiliary data structure is not allowed. After flattening, left of each node should… Read More

Given a linked list. The task is to change the value of the previous and next node of a node to 0 if the current… Read More

Given a singly linked list containing N nodes, the task is to delete all nodes from the list which are not prime.Examples: Input : List… Read More

Given a singly linked list. The task is to find the average of all nodes of the given singly linked list.Examples: Input: 7->6->8->4->1 Output: 26… Read More

Static Queue: A queue is an ordered list of elements. It always works in first in first out(FIFO) fashion. All the elements get inserted at… Read More

Given a singly circular linked list. The task is to find the sum and product of nodes which are divisible by K of the given… Read More

Delete all odd or even position nodes from circular linked list Given a Singly Circular Linked List, starting from the first node delete all odd… Read More

Given a Circular Linked List. The task is to write programs to delete nodes from this list present at: First position. Last Position. At any… Read More

Given two polynomials in the form of linked list. The task is to find the multiplication of both polynomials. Examples: Input: Poly1: 3x^2 + 5x^1… Read More

Given a singly circular linked list of nodes. The task is to find the smallest and largest elements in the circular linked list. Examples: Input :… Read More

Given a singly linked list containing N nodes, the task is to find the total count of prime numbers. Examples: Input: List = 15 ->… Read More

Given a singly linked list which is sorted in ascending order and another singly linked list which is unsorted. The task is to print the elements of… Read More