今天刷的题是LeetCode第206题
class Solution { public ListNode reverseList(ListNode head) { return this.recursion(head,null); } public ListNode recursion(ListNode head,ListNode pre){ if (head==null){ return pre; } ListNode node=head.next; head.next=pre; return this.recursion(node,head); } }
原文:https://www.cnblogs.com/cquer-xjtuer-lys/p/11602504.html