• + 0 comments
    def reverse(llist):
        head = llist
        last = None    # hold onto last visited note
        while head:
    		
            tmp = head.next
            head.next = head.prev
            head.prev = tmp
    				
            last = head
            head = tmp
        return last