You are viewing a single comment's thread. Return to all comments →
I think the fast pointer is guaranteed to cycle through the loop exactly exactly twice before it meets the slow pointer, so it's not really that bad.
Seems like cookies are disabled on this browser, please enable them to open this website
Linked Lists: Detect a Cycle
You are viewing a single comment's thread. Return to all comments →
I think the fast pointer is guaranteed to cycle through the loop exactly exactly twice before it meets the slow pointer, so it's not really that bad.