Esempio n. 1
0
 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;
     }
 }
Esempio n. 2
0
 public DoubleLinkedList()
 {
     head = null;
     tail = null;
 }
Esempio n. 3
0
 public DoubleLinkedListNode(int n)
 {
     this.n = n;
     next   = null;
     prev   = null;
 }