public void Insert(int n) { if (head == null && tail == null) { head = new DoubleLinkedListNode(n); tail = head; } else { DoubleLinkedListNode temp = new DoubleLinkedListNode(n); tail.next = temp; temp.prev = tail; tail = tail.next; } }
public DoubleLinkedList() { head = null; tail = null; }
public DoubleLinkedListNode(int n) { this.n = n; next = null; prev = null; }