Relative Content

Tag Archive for algorithmlogicfloyd-cycle-finding

Detecting Start of Cycle inn Floyd’s Cycle Detection Algorithm

Assuming there is a hare and a tortoise at the beginning and the hare moves 2 steps at one time while the tortoise moves 1 step. If there is a cycle in the sequence, they both will meet finally at some point. Or if there’s no such a cycle, they will both reach the end.
Where does the cycle start from?