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āfast or fast.next is None?
Cycle detected
Cycle detected
Two pointers move at different speeds through the list. If they meet, a cycle exists. If fast pointer reaches end, no cycle.
