I have understood the algorithm but my major doubt is how do we create a loop in a LL

i have understood the algorithm but my major doubt is how do we create a loop in a LL to test cycle detection

hi @utkarsh.gupta0311
1)connect the tail to the head
2)that will be given to u, just write cycle detection code
do this question https://practice.geeksforgeeks.org/problems/detect-loop-in-linked-list/1

ohk i got it. thank u. if i face pblm in loop i let u know

yup sure @utkarsh.gupta0311, mark this as resolved then

1 Like

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.