链表模版 Ian 2023-02-02 约 35 字 预计阅读 1 分钟 次阅读 目录 反转链表 反转链表 1 2 3 4 5 6 7 8 def reverse(head): tail = head while tail and tail.next: tmp = tail.next tail.next = tmp.next tmp.next = head head = tmp return head Please enable JavaScript to view the comments powered by Valine.