• + 0 comments

    recursive python solution:

    def reverse(llist):
        if llist == None or llist.next == None:
            return llist
            
        new_head = reverse(llist.next)
        llist.next.next = llist
        llist.next = None
        
        return new_head