思路 pre 记录已反转的链表cur 记录正在反转的链表节点next 记录还未反转的链表 func reverseList(head *ListNode) *ListNode { if head == nil || head.Next == nil { return head } pre, cur, next := (*ListNode)(nil), head, head for cur.Next != nil { next = cur.Next cur.Next = pre pre = cur cur = next } cur.Next = pre return cur }