Concept Flow - Detect Cycle in Linked List Floyd's Algorithm
Start: slow = head, fast = head
Move slow by 1 step
Move fast by 2 steps
Check if slow == fast?
No→Check if fast or fast.next is null?
Cycle detected, exit
The slow pointer moves one step, fast pointer moves two steps. If they meet, a cycle exists. If fast reaches null, no cycle.
