24. Swap Nodes in Pairs
来源:互联网 发布:软件系统安全策略 编辑:程序博客网 时间:2024/06/06 20:15
public static ListNode swapPairs(ListNode head) { ListNode pre = null, cur =null; if(head == null){ return head; }else { pre = head; cur = head.next; } while(cur!=null) { int tmp = pre.val; pre.val = cur.val; cur.val = tmp; pre = cur.next; if(pre != null) { cur = pre.next; }else{ cur = null; } } return head; }
0 0
- 24. Swap Nodes in Pairs
- 24. Swap Nodes in Pairs
- 24.Swap Nodes in Pairs
- 24. Swap Nodes in Pairs
- 24. Swap Nodes in Pairs
- 24. Swap Nodes in Pairs
- 24. Swap Nodes in Pairs
- 24. Swap Nodes in Pairs
- 24. Swap Nodes in Pairs
- 24. Swap Nodes in Pairs
- 24. Swap Nodes in Pairs
- 24. Swap Nodes in Pairs
- 24. Swap Nodes in Pairs
- 24. Swap Nodes in Pairs
- 24. Swap Nodes in Pairs
- 24. Swap Nodes in Pairs
- 24. Swap Nodes in Pairs
- 24. Swap Nodes in Pairs
- 【jzoj4821】【打膈膜】
- Linux成长之路(二)——Linux目录结构和对文件的基本操作
- 拖拽案例
- C++中的纯虚函数
- zookeeper、dubbo整合搭建rpc(基于springMVC)
- 24. Swap Nodes in Pairs
- 循环链表
- BeautifulSoup安装
- HandsFree——OpenRE库学习(二)
- 53. 使 Ajax 可缓存(14)
- hduoj1239
- Java进阶(四十七)Socket通信
- csv.Error: line contains NULL byte解决方法
- SQL Server全文检索