I have code the cicular linked list problem using floyd’s cylce algorithm.
But is showing me run time error.
can you help me to figure out the mistake i am doing?
The link of my code is:
I have code the cicular linked list problem using floyd’s cylce algorithm.
But is showing me run time error.
can you help me to figure out the mistake i am doing?
The link of my code is:
Hello @srivastavasagar2001,
The linked list you have formed is structurally linear.
There is no actual loop or cycle in it.
Thus, the fast and slow pointers will not work for the linked list you have created.
Solution:
Hope, this would help.
Give a like if you are satisfied.