LeetCode142 链表的环 II

https://leetcode.com/problems/linked-list-cycle-ii/ 解释转自https://blog.csdn.net/willduan1/article/details/50938210 如图所示,链表的整个长度为L,链表头head为h,假设fp和sp按照箭头所示的方向走。其中环入口点为d,h到d的距离hd为a。fp和sp假设初次相遇在c,初次相遇的时候慢指针
相关文章
相关标签/搜索