struct ListNode* swapPairs(struct ListNode* head) {
if (head == NULL || head->next == NULL) {
return head;
}
struct ListNode* newHead = head->next;
head->next = swapPairs(newHead->next);
newHead->next = head;
return newHead;
}
05-16
167
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
02-09
1554
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)