public static DoublyLinkedNode ReverseDoublyLinkedList(DoublyLinkedNode head) { if (head == null) return null; DoublyLinkedNode current = head; DoublyLinkedNode temp; while(current!=null) { temp=current.NextNode; current.NextNode = current.PreNode; current.PreNode = temp; head = current; current = temp; } return head; }