Java Reference
In-Depth Information
7.
list
4
3
8.
list
1
2
9.
list.next.next = new ListNode(3, null); // 2
-
> 3
10.
list = new ListNode(3, list); // 3
-
> 1 and list
-
> 3
11.
temp.next.next = list.next; // 4
-
> 2
list.next = temp; // 1
-
> 3
12.
ListNode list2 = list; // list2
-
> 1
list = list.next; // list
-
> 2
list2.next = list2.next.next; // 1
-
> 3
list.next = null; // 2 /
13.
ListNode temp = list; // temp
-
> 5
list = list.next; // list
-
> 4
temp.next = list.next; // 5
-
> 3
list.next = temp; // 4
-
> 5
14.
ListNode temp = list.next.next; // temp
-
> 3
temp.next = list.next; // 3
-
> 4
list.next.next = list; // 4
-
> 5
list.next.next.next = null; // 5 /
list = temp; // list
-
> 3
15.
list.next.next.next = temp; // 3
-
> 4
temp.next.next = list.next.next; // 5
-
> 3
list.next.next = null; // 2 /
ListNode temp2 = temp.next; // temp2
-
> 5
temp.next = list.next; // 4
-
> 2
list = temp2; // list
-
> 5
16.
list2.next.next.next = list; // 4
-
> 1
list.next = list2; // 1
-
> 2
list = list2.next.next; // list
-
> 4
list2 = list2.next; // list2
-
> 3
list2.next = null; // 3 /
list.next.next.next = null; // 2 /
17.
ListNode list2 = list.next.next; // list2
-
> 3
list.next.next.next.next = list.next; // 4
-
> 2
ListNode temp = list; // temp
-
> 1
list = list.next.next.next; // list
-
> 4
list2.next = temp; // 3
-
> 1
list.next.next = null; // 2 /
list2.next.next = null; // 1 /
Search WWH ::
Custom Search