newszine

Partition a Linked List | Linked List Problem | LeetCode 86

4 years ago Lalit Bhagtani 0
Problem Statement You have given a singly linked list and an integer value X. Partition the given linked list in such a way that all nodes whose value is less than X come before the nodes whose values are greater than or equal to X. Example  Input :- head = Read More

Flatten a Multilevel Doubly Linked List | LeetCode 430

4 years ago Lalit Bhagtani 1
Problem Statement You have given a doubly linked list which in addition to the next and previous pointers, it also has a child pointer, which may or may not point to a separate doubly linked list. These child lists may have one or more children of their own, and so on, to produce a multilevel Read More

Reverse a Linked List | Linked List Problem

4 years ago Lalit Bhagtani 0
Problem Statement You have given a singly linked list, write a program to reverse the linked list. Try to do it in-place by changing links between the nodes. Example  Input :- head = Output :- Input :- head = Read More

Remove Cycle from Linked List | Linked List Problem

4 years ago Lalit Bhagtani 0
Problem Statement You have given a singly linked list if a linked list contains a cycle, then remove the cycle and return the same linked list. If there is no cycle, then return the same linked list. Note :- Cycle in the given linked list is represented by an integer position, which represents the position Read More