import java.util.*; /** * Definition for singly-linked list. * class ListNode { * int val; * ListNode next; * ListNode(int x) { * val = x; * next = null; * } * } */ public class Solution { public boolean hasCycle(ListNode head) { // 解题思路:1.快慢指针,从相同起点出发,fast 每次走2布,slow走1布 // 循环条件 fast 不等于null 且 fast....