Floyd Cycle-Finding Algorithm
Floyd’s Cycle-Finding Algorithm Basic Algo Floyd Cycle Algorithm states that: Traverse linked list using two pointers. Move one pointer(slow_p or tortoise or walker) by one and another pointer(fast_p or hare or runner) by two. If these pointers meet at the same node then there is a loop. If pointers do not meet then linked list doesn’t have a loop. This is also called tortoise and hare approach. ...