Floyd’s Cycle Detection Algorithm

  • Maintain slow and fast pointer
  • Contain cycle if the two pointers meet