Swap Nodes in Pairs 11行AC
来源:互联网 发布:软件测试实验室设备 编辑:程序博客网 时间:2024/05/16 09:45
class Solution {public: ListNode* swapPairs(ListNode* head) { ListNode new_head(0);new_head.next = head; ListNode* iter = &new_head; while (iter->next && iter->next->next) { ListNode *tmp1 = iter->next, *tmp2 = iter->next->next->next; iter->next = iter->next->next; iter->next->next = tmp1; tmp1->next = tmp2; iter = tmp1; } return new_head.next; }};
0 0
- Swap Nodes in Pairs 11行AC
- Swap Nodes in Pairs
- Swap Nodes in Pairs
- Swap Nodes in Pairs
- Swap Nodes in Pairs
- Swap Nodes In Pairs
- Swap Nodes in Pairs
- Swap Nodes in Pairs
- Swap Nodes in Pairs
- Swap Nodes in Pairs
- Swap Nodes in Pairs
- Swap Nodes in Pairs
- Swap Nodes in Pairs
- Swap Nodes in Pairs
- Swap Nodes in Pairs
- Swap Nodes in Pairs
- Swap Nodes in Pairs
- Swap Nodes in Pairs
- Go语言编程(旧读书笔记)
- L脚本语言实现文件加解密
- 汇编+内核+代码阅读
- qca4004模块离线不上线原因分析
- 捐赠8千件文物 政府百万奖金10年未兑现(图)
- Swap Nodes in Pairs 11行AC
- Android listView 动态加载数据,下拉加载数据,上拉加载数据
- MTBF
- 华为机试—5张扑克牌的组成
- OSI模型以及理解
- twemproxy explore
- Android开发中 软件盘将布局遮住的问题
- 真正了解单列模式
- 杂言