I was asked this question in interview: “How to detect the loop in linked list?”, I solved this but immediately the interviewer asked me how do I remove the loop in a linked list. I fumbled.
So any pointers on how to solve this, may be pseudo code, or method definition?
I’m comfortable with Java so I have tagged this question under java.
For Instance this linked list has a loop