Skip to content

Category Archives: Linked List

Given a doubly linked list containing N nodes and a number X, the task is to delete all the nodes from the list that are… Read More
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:   Input:… Read More
Given a linked list, rearrange it such that converted list should be of the form a < b > c < d > e <… Read More
We have discussed Floyd’s fast and slow pointer algorithms in Detect loop in a linked list. Attention reader! Don’t stop learning now. Get hold of… 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
Write a C function that moves first element to end in a given Singly Linked List. For example, if the given Linked List is 1->2->3->4->5,… Read More
Prerequisite – Hashing Introduction, Hashtable using Singly Linked List & Implementing our Own Hash Table with Separate Chaining in Java Implementing hash table using Chaining… Read More
Sort the given biotonic doubly linked list. A biotonic doubly linked list is a doubly-linked list which is first increasing and then decreasing. A strictly… Read More
Given a set of strings, find the longest common prefix. Examples:Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with… Read More
Given a linked list with n nodes, reverse it in the following way :   If n is even, reverse it in group of n/2 nodes.… Read More
Given a singly linked list, delete all occurrences of a given key in it. For example, consider the following list. Input: 2 -> 2 ->… Read More
Prerequisite: Merge Sort for Linked Lists Merge sort is often preferred for sorting a linked list. The slow random-access performance of a linked list makes… Read More
Given a doubly linked list, the task is to find the size of that doubly linked list. For example, size of below linked list is… Read More
Write a removeDuplicates() function which takes a list sorted in non-decreasing order and deletes any duplicate nodes from the list. The list should only be… Read More
Given a linked list, the problem is to delete all the nodes from the list that are greater than the specified value x. Examples:Attention reader!… Read More