LeetCode 206 Reverse Linked List
2015-12-07 09:35
344 查看
题目描述
Reverse a singly linked list.代码
[code] public ListNode reverseList(ListNode head) { if (head == null) { return null; } if (head.next == null) { return head; } ListNode tail = head.next; ListNode reversed = reverseList(head.next); // 前后翻转tail和head tail.next = head; head.next = null; return reversed; }
相关文章推荐
- IOS开发之启动画面延时
- CSS常用选择器名
- js将数字转成大写中文
- 【转】深入浅出:Linux设备驱动之字符设备驱动
- [通达信公式] 爵府6号源码
- Planning for Reality
- Greenplum的安装
- android layout-weight属性
- Redis主从配置
- 绝对定位与相对定位
- 乘除:
- GSM cell phone calls use outdated encryption that can now be cracked with rainbow tables on a PC
- IT Program Management: Shared Vision
- Centos 操作指令-2
- [leetcode] 223. Rectangle Area
- HTTPS接口加密和身份认证
- 简介iOS开发中应用SQLite的模糊查询和常用函数
- xbox one开发机 错误代码E200 E305
- 使用CocoaPods时提示the command path could not be resolved问题
- iOS App被拒的各种理由