一、python链表结构 class ListNode: def __init__(self, x): self.val = x self.next = None 二、输入,输出 输入:链表头结点 输出:反向链表的头结点 @param head ListNode类 @return ListNode类 三、解题思路 要区分!=None与not,均可以,但易错。 算法流程图解 要注意先判断head==None和head.next==None !=None的写法: class Solution: def ReverseList(self , head: ListNode) -&...