## Sort a linked list of 0s, 1s and 2s

Given a linked list of 0s, 1s and 2s, sort it. Examples: Input: 1 -> 1 -> 2 -> 0 -> 2 -> 0 ->… Read More »

- Create linked list from a given array
- Add Two Numbers Represented by Linked Lists | Set 3
- Introduction to Data Structures | 10 most commonly used Data Structures
- Add the given digit to a number stored in a linked list
- Print the last k nodes of the linked list in reverse order | Iterative Approaches
- Convert a given Binary Tree to Circular Doubly Linked List | Set 2
- Bubble Sort for Linked List by Swapping nodes
- Create new linked list from two given linked list with greater element at each node
- Linked List Implementation in C#
- Delete Nth node from the end of the given linked list
- Reverse a Linked List in groups of given size (Iterative Approach)
- Count duplicates in a given linked list
- Find sum of even and odd nodes in a linked list
- Iterative selection sort for linked list
- Maximum sum of K consecutive nodes in the given Linked List
- Program to unfold a folded linked list
- Reverse alternate K nodes in a Singly Linked List - Iterative Solution
- Correct the Random Pointer in Doubly Linked List
- Sum of all distinct nodes in a linked list
- Sum of nodes in a linked list which are greater than next node
- Find the balanced node in a Linked List
- Add one to a number represented as linked list | Set 2
- Divide the given linked list in two lists of size ratio p:q
- Insert N elements in a Linked List one after other at middle position
- Create a linked list from two linked lists by choosing max element at each position
- Sum of smaller elements of nodes in a linked list
- Maximum sum contiguous nodes in the given linked list
- Remove Nth node from end of the Linked List
- Sum of all odd frequency nodes of the Linked List
- Check whether the sum of element of a node is equal to the given key value

Given a linked list of 0s, 1s and 2s, sort it. Examples: Input: 1 -> 1 -> 2 -> 0 -> 2 -> 0 ->… Read More »

Given two numbers represented by two linked lists, write a function that returns the sum list. The sum list is linked list representation of the… Read More »

Given a linked list where every node represents a linked list and contains two pointers of its type: (i) Pointer to next node in the… Read More »

Given a singly linked list, rotate the linked list counter-clockwise by k nodes. Where k is a given positive integer. For example, if the given… Read More »

Given three linked lists, say a, b and c, find one node from each list such that the sum of the values of the nodes… Read More »

In the previous post, we discussed how a Doubly Linked can be created using only one space for address field with every node. In this… Read More »

Given two Linked Lists, create union and intersection lists that contain union and intersection of the elements present in the given lists. Order of elments… Read More »

Given a Doubly Linked List which has data members sorted in ascending order. Construct a Balanced Binary Search Tree which has same data members as… Read More »

Given a Singly Linked List which has data members sorted in ascending order. Construct a Balanced Binary Search Tree which has same data members as… Read More »

Given a Singly Linked List, write a function to delete a given node. Your function must follow following constraints: 1) It must accept a pointer… Read More »

Consider simple representation (without any dummy node) of Linked List. Functions that operate on such Linked lists can be divided in two categories: 1) Functions… Read More »

Given two numbers represented by two lists, write a function that returns the sum list. The sum list is list representation of the addition of… Read More »

An ordinary Doubly Linked List requires space for two address fields to store the addresses of previous and next nodes. A memory efficient version of… Read More »

Write a function detectAndRemoveLoop() that checks whether a given Linked List contains loop and if loop is present then removes the loop and returns true.… Read More »

Given a Linked List of integers, write a function to modify the linked list such that all even numbers appear before all the odd numbers… Read More »