快慢指针 Posted on 2020-04-04 | Post modified: 2020-04-04 | In Algorithms Words count in article: 96 | Reading time ≈ 1 快慢指针 快慢指针中的快慢指的是移动的步长,即每次向前移动速度的快慢。例如可以让快指针每次沿链表向前移动2,慢指针每次向前移动1次. 寻找链表的中间节点 123456slow = headfast = headwhile fast.next and fast.next.next: slow = slow.next fast = fast.next.nextslow = slow.next 判断链表是否有环