Delete all the nodes from the list which are divisible by any given number K

Given a Linked List and a key K. The task is to write a program to delete all the nodes from the list that are… Read More »

Search an Element in Doubly Circular Linked List

Pre-requisite: Convert an Array to a Circular Doubly Linked List, Doubly Circular Linked List Given a Doubly circular linked list. The task is to find… Read More »

Segregate even and odd nodes in a Linked List using Deque

Given a Linked List of integers. The task is to write a program to modify the linked list such that all even numbers appear before… Read More »

Insertion at Specific Position in a Circular Doubly Linked List

Prerequisite: Insert Element Circular Doubly Linked List. Convert an Array to a Circular Doubly Linked List. Given the start pointer pointing to the start of… Read More »

Convert an Array to a Circular Doubly Linked List

Prerequisite: Doubly Linked list, Circular Linked List, Circular Doubly Linked List Given an array of N elements. The task is to write a program to… Read More »

Reverse nodes of a linked list without affecting the special characters

Given a linked list of alphabets and special characters. Reverse the given linked list without affecting the position of the special characters. Examples: Input: g… Read More »

Flatten a binary tree into linked list | Set-2

Given a binary tree, flatten it into a linked list. After flattening, the left of each node should point to NULL and right should contain… Read More »

Construct a linked list from 2D matrix (Iterative Approach)

Given a matrix, the task is to construct a linked list matrix in which each node is connected to its right and down node. Example:… Read More »

Rearrange a Linked List in Zig-Zag fashion | Set-2

Given a linked list, rearrange it such that converted list should be of the form a < b > c < d > e <… Read More »

Maximum occurring character in a linked list

Given a linked list of characters. The task is to find the maximum occurring character in the linked list. if their are multiple answer return… Read More »

Iterative approach for removing middle points in a linked list of line segements

This post explains the iterative approach of this problem. We maintain two pointers, prev and temp. If these two have either x or y same,… Read More »

Java.util.LinkedList.poll(), pollFirst(), pollLast() with examples in Java

Java’s Linked list class offers a function that allows a “Queue Based” working called poll(). This function not only returns deletes the first element, but… Read More »