leetcode 206 反转链表的三种解法

方法一:递归法python #递归法 class Solution: def reverseList(self, head: ListNode) -> ListNode: if head==None or head.next==None: return head #反转后的末尾 也就是第一个 cur=self.reve
相关文章
相关标签/搜索