赞
踩
题目:
题解:
- class Solution {
- public ListNode reverseList(ListNode head) {
- if (head == null || head.next == null) {
- return head;
- }
- ListNode newHead = reverseList(head.next);
- head.next.next = head;
- head.next = null;
- return newHead;
- }
- }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。