You are viewing a single comment's thread. Return to all comments →
def reverse(cur): while cur: cur.prev, cur.next = cur.next, cur.prev if not cur.prev: return cur cur = cur.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 →