how we can take the input of linked list containing cycle ?
Doubt in Floyd Cycle Video
Hello,
What you can do is while inserting a new node check if it already occurred in the link list before or not:
-
if yes, then it means that numbers has started repeating.
then point the last node to node containing that element. -
if no, then keep inserting the new node to the last of linked list.
Hope, this would help.
Give a like, if it is satisfied.