思路:递归
class Solution {
public ListNode swapPairs(ListNode head) {
if (head == null || head.next == null){
return head;
}
ListNode first = head;
ListNode second = first.next;
ListNode third = second.next;
second.next = first;
first.next = swapPairs(third);
return second;
}
}