The input is given in the form of a simple sequence , how can we detect it with floyds algorithm. Please help me out to find the modifications in the buildList function and in the floyd’s algorithm.
How to take the input?
Hello @7nishit,
What you can do here:
- While building the list, just check if any element of the list starts repeating.
- Find that node and point the last node to this node that has started repeating.
Hope, this would help.
Give a like if you are satisfied.
I have to check the complete list after the first repetitive node then, it would be a tedious task to do.
Hello @7nishit,
You can refer to this code I have written:
Hope, this would help.
Let me know if you face any issue.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.