You are viewing a single comment's thread. Return to all comments →
Using recursion in Python :
def reverse(head): if head.next is None: head.next = head.prev head.prev = None return head else: old_next = head.next head.next = head.prev head.prev = old_next return reverse(head.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 →
Using recursion in Python :