Swap Nodes In Pairs
Given a linked list, swap every two adjacent nodes and return its head.
“You may not modify the values in the list’s nodes, only nodes itself may be changed.l”
Solution1
1 |
|
Solution2
1 | public ListNode swapPairs(ListNode head) { |
Swap Nodes In Pairs
Given a linked list, swap every two adjacent nodes and return its head.
“You may not modify the values in the list’s nodes, only nodes itself may be changed.l”
1 |
|
1 | public ListNode swapPairs(ListNode head) { |