## How to remove duplicates from a sorted doubly linked list

[Question]: Given a sorted doubly linked list head. Remove duplicate nodes from the given list. #Approach: Step 1: Compare current node item with next node item Step 2: If two items same move next pointer to next’s nextStep 3: If current Node & next Node doesn’t match use node = next

## How to find find pairs with given sum in doubly linked list

[Question]: Given a sorted doubly linked list of positive distinct elements, Find pairs in a doubly-linked list whose sum is equal to given value k, without using any extra space?  #Approach. Using two pointer

## How to Delete all occurrences of a given key in a doubly linked list

[Question]: Given a doubly linked list and a key x. The problem is to delete all occurrences of the given key x from the doubly linked list. #Approach: we declare two variable prevNode and nxtNode and in a loop if we finds the data value of linklist node is equals to k just break link to the node.

## How to add 1 number to a number represented linked list

[Question]: 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 represented as (1-> 9-> 9 -> 9) and adding 1 to it should change it to (2->0->0->0)  #Approach:

## How to Sort linked list of 0s, 1s and 2s

[Question]: Given a singly linked list head sort it with with all with zeros, ones and two’sExample:Input: 1 -> 1 -> 2 -> 0 -> 2 -> 0 -> 1 -> NULL Output: 0 -> 0 -> 1 -> 1 -> 1 -> 2 -> 2 -> NULL Approach: Create count array which stores count of 0’s, 1’s …

## How to Sort Linked List ?

[Question]: Given Head of singly linked list return a sorted linkedlist head(ascending order.)Criteria: -TC should O(n) SC: O(1) Input: head = [4,2,1,3] Output: [1,2,3,4] #Approach : We can use merge sort: which work on divide & conquer

## How to check if linked list is palindrome?

[Question]: Input singly linked list return true if linked list is palindrome.Example: – Input: head = [1,2,2,1] Output: true Approach# Reverse Linked list & compare first and last item