You are viewing a single comment's thread. Return to all comments →
Recursive approach
def reverse(llist): if llist is None: return None next_node = llist.next llist.next, llist.prev = llist.prev, llist.next if next_node is None: return llist return reverse(next_node)
Seems like cookies are disabled on this browser, please enable them to open this website
Reverse a doubly linked list
You are viewing a single comment's thread. Return to all comments →
Recursive approach