9102年来啦，怎么还是随手一戳就是盲点呢(:з」∠)

# Floyd cycle-finding algorithm

Robert W. Floyd describes algorithms for listing all simple cycles in a directed graph in a 1967 paper, but this paper does not describe the cycle-finding problem in functional graphs that is the subject of this article. In fact, Knuth’s statement (in 1969), attributing it to Floyd, without citation, is the first known appearance in print, and it thus may be a folk theorem, not attributable to a single individual.

## 如何定位环？

• 乌龟T和兔子H同时从起点A出发，相遇的点在B（B是环上某一点），环开始的位置（从链表头部算起进入环的位置）为C（也就是我们要找到的位置）
• 相遇时乌龟走了k步；兔子走了2k
• 设|AC| = a, |CB| = b, |BC| = c，我们取最简单的情况，也就是乌龟第一次进入环，兔子完整地跑完了一次环

a + b = k
a + b + b + c = 2k
=> a = c