Exemplo n.º 1
0
        public void Add(DoublyLinkedListNode <T> newNode)
        {
            if (head == null)
            {
                head = newNode;
            }
            else
            {
                var current = head;
                while (current != null && current.Next != null)
                {
                    current = current.Next;
                }

                current.Next = newNode;
                newNode.Prev = current;
                newNode.Next = null;
            }
        }
Exemplo n.º 2
0
 public DoublyLinkedListNode(T data, DoublyLinkedListNode <T> prev, DoublyLinkedListNode <T> next)
 {
     this.Data = data;
     this.Prev = prev;
     this.Next = next;
 }
Exemplo n.º 3
0
 public DoublyLinkedListNode(T data) : this(data, null, null)
 {
     this.Data = data;
     this.Prev = null;
     this.Next = null;
 }