Regarding Floyd's cycle-finding algorithm

  • Level: Undergrad 
  • Thread starter cyberfrenzy
  • Start date
  • Tags Tags
    Algorithm
1 reply · 5K views · last reply
cyberfrenzy
Messages
3
Reaction score
0
Well I understand what is happening - the tortoise moving 1 step, and the hare moving 2 steps and finally coinciding at a point. But I want a mathematical proof of this - ie; when you have 2 counters moving in a cycle, one going 1 step, the other 2 steps, then they finally meet at a point.
 
Suppose that they start M places apart (suitably oriented) on a cycle of size N. How many places apart are they after k steps?