You are viewing a single comment's thread. Return to all comments →
I don't understand your comment. He never checks the node's data, he checks the memory reference pointer by adding head in the set and not head.data.
Linked Lists: Detect a Cycle
You are viewing a single comment's thread. Return to all comments →
I don't understand your comment. He never checks the node's data, he checks the memory reference pointer by adding head in the set and not head.data.