leetcode 24. Swap Nodes in Pairs
2017-02-01 12:50
267 查看
class Solution { public: ListNode* swapPairs(ListNode* head) { if ( head==NULL ||head->next == NULL ) { return head; } ListNode *res = head->next; ListNode *temp = head->next->next; head->next->next = head; head->next = swapPairs(temp); return res; } };
相关文章推荐
- leetcode 24. Swap Nodes in Pairs
- 24. Swap Nodes in Pairs Leetcode Python
- leetcode 24. Swap Nodes in Pairs
- LeetCode --- 24. Swap Nodes in Pairs
- leetcode_24. Swap Nodes in Pairs C++
- **LeetCode 24. Swap Nodes in Pairs
- leetcode 24. Swap Nodes in Pairs
- <LeetCode OJ> 24. Swap Nodes in Pairs
- leetcode 24. Swap Nodes in Pairs
- 24.[Leetcode]Swap Nodes in Pairs
- Leetcode ☞ 24. Swap Nodes in Pairs ☆
- leetcode 24. Swap Nodes in Pairs(链表)
- LeetCode *** 24. Swap Nodes in Pairs
- (Java)LeetCode-24. Swap Nodes in Pairs
- [leetcode] 24. Swap Nodes in Pairs 解题报告
- LeetCode 24. Swap Nodes in Pairs 解题报告
- leetcode 24. Swap Nodes in Pairs
- LeetCode 24. Swap Nodes in Pairs
- Leetcode 24. Swap Nodes in Pairs (Easy) (cpp)
- [leetcode] 【链表】24. Swap Nodes in Pairs