Sort a Doubly Linked List using Merge Sort

Given a doubly linked list, sort it using merge sort algorithm.

In this post, we will see how to reverse a doubly linked list using iteration and recursion.

Given a linked list, pairwise swap its adjacent nodes. The swapping of data is not allowed, only links should be changed.

Given a linked list which can grow in both horizontal and vertical directions (right and down), flatten it into a sorted singly linked list provided that each horizontal and vertical list is already sorted.

Check if a linked list of strings is palindromic

Given a linked list of strings, check whether concatenation of all values in the list together forms a palindrome. It is not permissible to construct a string out of the linked list nodes and check that string for palindrome.

Given a list which can grow in both horizontal and vertical directions (right and down), flatten it into a singly linked list. The conversion should be in such a way that down node is processed before the next node for any node.

Swap K’th node from beginning with K’th node from end in a Linked List

Given a linked list, swap its k’th node from beginning with its k’th node from end. The swapping should be done in such a way that only links between the nodes are exchanged, and no data is swapped.

Print nodes of a given binary tree in vertical order

Given a binary tree, print its nodes in vertical order. Assume that the left and right child of a node makes 45 degree angle with the parent.

Link nodes present in each level of a binary tree in the form of a linked list

Given a binary tree, write an efficient algorithm to link nodes at the same level in the form of a linked list like structure.

Given a multilevel linked list, convert it into a singly linked list in such a way that all nodes of first level appears first, followed by all nodes of second level, and so on. The multilevel linked list is similar to the simple linked list except that it has one extra field which points to …

Rearrange a Linked List by Separating Odd Nodes from the Even Ones

Given a linked list, rearrange it by separating odd nodes from even ones. All even nodes should come before all odd nodes in the output list and the relative order of even and odd nodes should be maintained.

In-place merge two sorted linked lists without modifying links of the first list

Given two sorted linked lists, merge them without using extra space and without modifying links of the first list. The solution should preserve the sorted order of elements in both lists.