##
Sublist Search (Search a linked list in another list)
January 18, 2017

Given two linked lists, the task is to check whether the first list is present in 2nd list or not. Input : list1 = 10->20… Read More »

January 18, 2017

Given two linked lists, the task is to check whether the first list is present in 2nd list or not. Input : list1 = 10->20… Read More »

January 9, 2017

Given a linked list and a value x, partition it such that all nodes less than x come first, then all nodes with value equal… Read More »

December 19, 2016

Given pointer to the head node of a linked list, the task is to reverse the linked list. Examples: Input : Head of following linked… Read More »

November 30, 2016

Given a sorted singly linked list and a value x, the task is to find pair whose sum is equal to x. We are not… Read More »

November 23, 2016

Given a sorted doubly linked list of positive distinct elements, the task is to find pairs in doubly linked list whose sum is equal to… Read More »

October 18, 2016

Like array and linked list, unrolled Linked List is also a linear data structure and is a variant of linked list. Unlike simple linked list,… Read More »

September 5, 2016

Given a Binary Tree, convert it to a Circular Doubly Linked List (In-Place). The left and right pointers in nodes are to be used as… Read More »

August 31, 2016

Given two linked lists that represent two large positive numbers. Subtract the smaller number from larger one and return the difference as a linked list.… Read More »

August 15, 2016

Given a list of integers, rearrange the list such that it consists of alternating minimum maximum elements using only list operations. The first element of… Read More »

July 23, 2016

We have discussed flattening of a multi-level linked list where nodes have two pointers down and next. In the previous post, we flattened the linked… Read More »

June 10, 2016

Given a singly linked list of 0s and 1s find its decimal equivalent. Input : 0->0->0->1->1->0->0->1->0 Output : 50 Input : 1->0->0 Output : 4… Read More »

Given K sorted linked lists of size N each, merge them and print the sorted output. Example: Input: k = 3, n = 4 list1… Read More »

Given a singly linked list, find if the linked list is circular or not. A linked list is called circular if it not NULL terminated… Read More »

June 8, 2016

Given a singly linked list, delete middle of the linked list. For example, if given linked list is 1->2->3->4->5 then linked list should be modified… Read More »

May 25, 2016

Given two sorted singly linked lists having n and m elements each, merge them using constant space. First n smallest elements in both the lists… Read More »