Beispiel #1
0
        public void Add(T value)
        {
            DbNode <T> newNode = new DbNode <T>(value);

            if (this.head == null)
            {
                // 如果链表当前为空则置为头结点
                this.head = newNode;
            }
            else
            {
            }
        }
Beispiel #2
0
        public DbNode <T> GetDbNodeByIndex(int index)
        {
            if (index < 0 || index > count)
            {
                throw new ArgumentOutOfRangeException("index", "索引超出范围");
            }
            DbNode <T> tempDbNode = this.head;

            for (int i = 0; i < index; i++)
            {
                tempDbNode = tempDbNode.NextNode;
            }
            return(tempDbNode);
        }
Beispiel #3
0
 public BaconDoubleLinkedList()
 {
     this.count = 0;
     this.head  = null;
 }