public static boolean isLoopLink(ListNode head) { if (head == null) { return false; } ListNode fast = head.next; ListNode slow = head; while (fast.next != null) { if (fast == slow) { return true; } fast = fast.next.next; slow = slow.next; } return false; }