Fast and Slow Pointer Visualization (Cycle Detection)

Problem Statement:

Detect Cycle in Linked List:
Given a linked list, determine if it has a cycle in it using the fast and slow pointer technique (Floyd’s Cycle Detection Algorithm).

Example: The linked list is: 1 → 2 → 3 → 4 → 5 → 6 and then loops back to node 3.
The fast pointer moves 2 steps, the slow pointer moves 1 step. If there is a cycle, they will meet.

Slow pointer at 0, Fast pointer at 0