Given a ternary tree, create a doubly linked list out of it. A ternary tree is just like binary tree but instead of having two… Read More »
Given a linked list which is sorted based on absolute values. Sort the list based on actual values. Examples: Input : 1 -> -10 output:… Read More »
Given a Binary Tree (BT), convert it to a Doubly Linked List(DLL) In-Place. The left and right pointers in nodes are to be used as… Read More »
Given a linked list handling string data, check to see whether data is palindrome or not? For example, Input : a -> bc -> d… Read More »
Given singly linked list with every node having an additional “arbitrary” pointer that currently points to NULL. We need to make the “arbitrary” pointer to… Read More »
Number is represented in linked list such that each digit corresponds to a node in linked list. Add 1 to it. For example 1999 is… Read More »
Given a linked list, rearrange it such that converted list should be of the form a < b > c < d > e <… Read More »
Rearrange a linked list in such a way that all odd position nodes are together and all even positions node are together, Examples: Input: 1->2->3->4… Read More »
Given a liked list and a key to be deleted. Delete last occurrence of key from linked. The list may have duplicates. Examples: Input: 1->2->3->5->2->10,… Read More »
In Java, LinkedList class implements the list interface. This class consists of the following methods : 1. boolean add(Object element) : It appends the element… Read More »
Given two linked lists sorted in increasing order. Merge them such a way that the result list is in decreasing order (reverse order). Examples: Input:… Read More »
Given a singly linked list and a position, delete a linked list node at the given position.
Given two linked lists, represented as linked lists (every character is a node in linked list). Write a function compare() that works similar to strcmp(),… Read More »
Given a singly linked list L0 -> L1 -> … -> Ln-1 -> Ln. Rearrange the nodes in the list so that the new formed… Read More »
Given a Linked List. The Linked List is in alternating ascending and descending orders. Sort the list efficiently.