Why does this code not return a reverse Linked List

前端 未结 0 1674
傲寒
傲寒 2021-02-09 19:49
Input = [1, 2, 3, 4, 5]

    def reverseList(self, head):
    prev = None
    while head:
        cur = head
        cur.next = prev
        head = head.next
        pre         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题