• + 0 comments

    My python solution :

    def reverse(llist):
        llist_2 = SinglyLinkedList()
        current = llist
        while current :
            node = SinglyLinkedListNode(current.data)
            node.next = llist_2.head
            llist_2.head = node
            current = current.next
        return llist_2.head