Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ListNode fast = head;
- ListNode slow = head;
- while(fast.next != null && fast.next.next != null){
- fast = fast.next.next;
- slow = slow.next;
- }
- ListNode cur = slow.next; // the head of the second half.
Add Comment
Please, Sign In to add comment