You are viewing a single comment's thread. Return to all comments →
If there's a cycle, the fast pointer will never reach an end since there is no node with no next node, and it will eventually meet the slow pointer.
Seems like cookies are disabled on this browser, please enable them to open this website
Cycle Detection
You are viewing a single comment's thread. Return to all comments →
If there's a cycle, the fast pointer will never reach an end since there is no node with no next node, and it will eventually meet the slow pointer.