&ldl demonstrating a simple cycle detection algorithm

  • Find node in loop (one moves at 2x speed)
  • Compute length of loop
  • Compute start of loop
    2 ways to get to the start of the loop:
  • Take s steps
  • Take s + l steps -> equivalent to taking l + s steps