Floyd cycle detections

while (slow_p && fast_p && fast_p->next)
what is the meaning of this line of code ???

@Vikaspal hey this is the condition which is applied for detecting loop ,it means move slow one time and fast two times until slowp not equal to NULL also fastp not equal to NULL and fast ka next is also not NULL as we are acessing fast ka next ka next ,hope you get it.

@rishabhmahajan546 got it brother

@Vikaspal hey bro please close the doubt and give rating if I solved your doubt .

@rishabhmahajan546 i want to know that how to construct the linked list like 1 2 3 4 2 3 -1 means after when any elements is repeating means it forming the linked list in circular fashion ??

@Vikaspal hey yes,for that we have used hashing see the input of above code,which I have send.

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.