You are viewing a single comment's thread. Return to all comments →
My answer in Python
def reverse(llist): prev = None current = llist while current: next_node = current.next current.next = prev current.prev = next_node prev = current current = next_node return prev
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 →
My answer in Python