예제 #1
0
 public void AddATail(int val)
 {
     if (this.Head == null)
     {
         AddATHead(val);
     }
     else
     {
         DoubleLinkedListNode tempNode = new DoubleLinkedListNode(val);
         DoubleLinkedListNode TailNode = GetTail();
         tempNode.Prev = TailNode;
         TailNode.Next = tempNode;
     }
 }
예제 #2
0
 public MyDoubleLinkedList()
 {
     Head = null;
 }
예제 #3
0
        public int GetIndexValue(int index)
        {
            DoubleLinkedListNode curr = GetIndexNode(index);

            return(curr == null ? -1 : curr.Val);
        }
예제 #4
0
 public DoubleLinkedListNode(int val)
 {
     this.Val  = val;
     this.Prev = this.Next = null;
 }