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

Find Length of Cycle in Linked List | Linked List Problem

4 years ago Lalit Bhagtani 0
Problem Statement You have given a singly linked list, return the length of cycle in the linked list. If there is no cycle, then return 0. Note :- Cycle in the given linked list is represented by an integer position, which represents the position (0-indexed)  in the linked list where the cycle begins. If position Read More

Find Starting Node of Cycle in Linked List | Linked List Problem

4 years ago Lalit Bhagtani 1
Problem Statement You have given a singly linked list, return the node of the linked list where cycle begins. If there is no cycle, then return null. Note :- Cycle in the given linked list is represented by an integer position, which represents the position (0-indexed)  in the linked list where the cycle begins. If Read More

Cycle in Linked List | Linked List Problem

4 years ago Lalit Bhagtani 0
Problem Statement You have given a singly linked list, find out if it contains a cycle or not. Example  Input :- head = , Cycle at 3rd Node Output :- true Input :- head = , No Cycle Output :- false Solution Floyd’s Cycle-Finding Read More