@@ -0,0 +1,800 @@
+/**%0A * Definition for singly-linked list.%0A * class ListNode %7B%0A *     int val;%0A *     ListNode next;%0A *     ListNode(int x) %7B%0A *         val = x;%0A *         next = null;%0A *     %7D%0A * %7D%0A */%0Apublic class Solution %7B%0A    public ListNode detectCycle(ListNode head) %7B%0A        ListNode fast = head;%0A        ListNode slow = head;%0A        %0A        while(fast != null && fast.next != null) %7B%0A            fast = fast.next.next;%0A            slow = slow.next;%0A            if (fast == slow) %7B%0A                fast = head;%0A                while(fast != slow) %7B%0A                    fast = fast.next;%0A                    slow = slow.next;%0A                %7D%0A                return fast;%0A            %7D%0A        %7D%0A        %0A        return null;%0A    %7D%0A%7D%0A%0A// slow pointer traveed = length of the cycle when two pointers meet.%0A

Create Linked_List_Cycle_II.java