1. Description: ![](https://img2020.cnblogs.com/i-beta/1475457/202003/1475457-20200302130610925-465532315.png)
Notes:
2. Examples: ![](https://img2020.cnblogs.com/i-beta/1475457/202003/1475457-20200302130656060-298172974.png)
3.Solutions:
1 /** 2 * Created by sheepcore on 2019-05-14 3 * Definition for singly-linked list. 4 * class ListNode { 5 * int val; 6 * ListNode next; 7 * ListNode(int x) { 8 * val = x; 9 * next = null; 10 * } 11 * } 12 */ 13 public boolean hasCycle(ListNode head) { 14 ListNode p = head,pre = head; 15 while(p != null && p.next != null){ 16 if (p.next == head) return true; 17 p = p.next; 18 pre.next = head; 19 pre = p; 20 } 21 return false; 22 }