You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
//this problem mainly improve the understanding of slow and pointers in the linked list which mainly used to detect loop in the linked list
Given the head of a linked list that may contain a loop. A loop means that the last node of the linked list is connected back to a node in the same list. The task is to Remove the loop from the linked list (if it exists).
eaxmple test case:-
input:1->2->3->4, pos = 1
this 'pos' tells to which position the end node is connceted in the given linked list, here 4 is connceted to 1 , which is at position 1.
output : 1->2->3->4
now there is no loops present in the linked list
The text was updated successfully, but these errors were encountered:
Amit-yadav099
changed the title
your liked list folder contains few codes , want to add "detect and remove loop in the linked list" problem ?
Your linked list folder contains few codes , want to add "detect and remove loop in the linked list" problem ?
Oct 13, 2024
//this problem mainly improve the understanding of slow and pointers in the linked list which mainly used to detect loop in the linked list
Given the head of a linked list that may contain a loop. A loop means that the last node of the linked list is connected back to a node in the same list. The task is to Remove the loop from the linked list (if it exists).
eaxmple test case:-
input:1->2->3->4, pos = 1
this 'pos' tells to which position the end node is connceted in the given linked list, here 4 is connceted to 1 , which is at position 1.
output : 1->2->3->4
now there is no loops present in the linked list
The text was updated successfully, but these errors were encountered: