You are viewing a single comment's thread. Return to all comments →
Java Solution:
public static DoublyLinkedListNode reverse(DoublyLinkedListNode llist) { DoublyLinkedListNode curr = llist; DoublyLinkedListNode prev = null; while(curr != null){ DoublyLinkedListNode next = curr.next; curr.next = prev; curr.prev = next; prev = curr; curr = next; } 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 →
Java Solution: