问题链接
https://leetcode.cn/problems/fan-zhuan-lian-biao-lcof/description/
解题思路
参考上一个题目。
代码
class ListNode: def __init__(self, x): self.val = x self.next = None class Solution: def reverseList(self, head): if head is None or head.next is None: return head last = self.reverseList(head.next) head.next.next = head head.next = None return last
标签:24,__,head,反转,self,None,next,链表 From: https://www.cnblogs.com/bjfu-vth/p/17024416.html