예제 #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;
            }
        }
예제 #2
0
 public DoublyLinkedListNode(T data, DoublyLinkedListNode <T> prev, DoublyLinkedListNode <T> next)
 {
     this.Data = data;
     this.Prev = prev;
     this.Next = next;
 }
예제 #3
0
 public DoublyLinkedListNode(T data) : this(data, null, null)
 {
     this.Data = data;
     this.Prev = null;
     this.Next = null;
 }