Leetcode Swap Nodes in Pairs
来源:互联网 发布:淘宝举报电话是多少 编辑:程序博客网 时间:2024/06/03 17:17
ListNode *swapPairs(ListNode *head) { ListNode dummy(-1); dummy.next = head; ListNode *cur = head; ListNode *prev = &dummy; ListNode *p; while(prev -> next != nullptr && prev -> next -> next != nullptr){ cur = prev -> next; p = cur -> next; // take out cur -> next = p -> next; // insert p -> next = cur; prev -> next = p; prev = cur; } return dummy.next; }
0 0
- LeetCode:Swap Nodes in Pairs
- LeetCode: Swap Nodes in Pairs
- [Leetcode] Swap Nodes in Pairs
- LeetCode : Swap Nodes in Pairs
- [LeetCode] Swap Nodes in Pairs
- Leetcode: Swap nodes in pairs
- [LeetCode]Swap Nodes in Pairs
- [LeetCode]Swap Nodes in Pairs
- LeetCode-Swap Nodes in Pairs
- LeetCode - Swap Nodes in Pairs
- LeetCode | Swap Nodes in Pairs
- 【leetcode】Swap Nodes in Pairs
- Leetcode: Swap Nodes in Pairs
- LeetCode - Swap Nodes in Pairs
- 【LeetCode】Swap Nodes in Pairs
- Leetcode: Swap Nodes in Pairs
- Leetcode Swap Nodes in Pairs
- LeetCode Swap Nodes in Pairs
- 【边做项目边学Android】手机安全卫士11-设置向导之设置安全号码
- Linux下权限问题:chmod -R 777 /usr
- Adapter中ViewHolder用法
- android知识点:inputType常用取值
- 对 云寻觅贴吧(http://tieba.yunxunmi.com/)的简要分析
- Leetcode Swap Nodes in Pairs
- Maven使用-安装
- Leetcode[Easy] - Pascal's Triangle II
- iOS播放短效音频
- linux硬盘分区格式化及挂载
- aapt.exe停止工作如何解决
- 代理
- Triangle
- MFC Radio Button 使用 分组 RadioButton 用法