Append odd position nodes in reverse at the end of even positioned nodes in a 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 »

Python program to find middle of a linked list using one traversal

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 »

Flatten a binary tree into linked list | Set-3

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 »

Update adjacent nodes if the current node is zero in a Singly Linked List

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 »

Delete all Non-Prime Nodes from a Singly Linked List

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

Program to find average of all nodes in a Linked List

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:… Read More »

Difference between a Static Queue and a Singly Linked List

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 »

Sum and Product of the nodes of a Circular Singly Linked List which are divisible by K

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 positioned nodes from Circular Linked List

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

Deletion at different positions in a Circular Linked List

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 »

Multiplication of two polynomials using Linked list

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 »

Find minimum and maximum elements in singly Circular Linked List

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 »

Count of Prime Nodes of a Singly Linked List

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 »

Print nodes of linked list at given indexes

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… Read More »

Sum and Product of all the nodes which are less than K in the linked list

Given a Linked List and a key K. The task is to calculate the sum and product all the nodes from the list that are… Read More »