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