Write a function to reverse a doubly Linked List.
public static void reverseDoublyLL(LinkedListNode head, LinkedListNode tail){ /* Swap head and tail pointer */ LinkedListNode temp = head; head = tail; tail = temp; /* Create a node pointing to head */ LinkedListNode current = head; while(current != null){ /* Swap previous and next pointer of each node */ temp = current.next; current.next = current.prev; current.prev = temp; } }