# 原地址
https://leetcode-cn.com/problems/linked-list-cycle-ii/
# 原理
首先环形判断通过快慢指针可以找到相遇点,为了找到环形开始点,只需要引入第三个指针从head开始,slow指针继续移动,当head和slow相遇,就是环形的切入点。
也是是如图所示,a==c

# 代码
```
/**
* Definition for singly-linked list.
* class ListNode {
* int val;
* ListNode next;
* ListNode(int x) {
* val = x;
* next = null;
* }
* }
*/
public class Solution {
public ListNode detectCycle(ListNode head) {
ListNode slow = head;
ListNode fast = head;
while(slow != null && fast!=null && fast.next !=null){
slow = slow.next;
fast = fast.next.next;
if(slow == fast){
ListNode ptr = head;
while (ptr != slow) {
ptr = ptr.next;
slow = slow.next;
}
return ptr;
}
}
return null;
}
}
```

142. 环形链表 II (链表)