You are viewing a single comment's thread. Return to all comments →
def reverse(llist): s=[] curr=llist while curr: s.append(curr.data) curr=curr.next node=llist for i in range(len(s)): node.data=s.pop() node=node.next return llist
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 →