Linked List Cycle
easyDetect if a linked list has a cycle using constant space
Linked List Cycle
Key Insight
Fast moves 2x; if there's a cycle, fast laps slow — they MUST meet
Step 1Setup
Cycle: 5 → 3
slow
fast
1
2
3
4
5
↩ cycle
List has a cycle: 5→3. Slow and fast both start at head.
1 / 5