Two walkers find a loop with no memory.
transcript
Does this chain ever end? You cannot write down every node. Two walkers can still tell. A loop would hide inside a long chain.
Node four points back at two. Slow takes one step. Fast takes two. Both start on node zero. Nothing is written down.
Round one. Slow is on one. Fast is on two. Round two. Slow is on two. Fast is on four. Round three. Both are on three. Fast gains one node every round.
Now a chain with no loop. Fast reaches the end first. They never meet. No loop. Fast reaches the end alone.
The time is linear. The memory is two variables. No record of any node. No node is ever copied.
Fast takes two steps. Move before you compare. Meeting means a loop. Check fast before you read ahead.
One slow, one fast. Meet means loop. Try it in the sandbox. Full breakdown in the lecture.