You are viewing a single comment's thread. Return to all comments →
i found an even shorter amazingly easy iterative solution in python on this site:
def Reverse (self): prev = None while self: prev = SinglyLinkedListNode (self.data, prev) self = self.next return prev
Seems like cookies are disabled on this browser, please enable them to open this website
Reverse a linked list
You are viewing a single comment's thread. Return to all comments →
i found an even shorter amazingly easy iterative solution in python on this site: