示例#1
0
        public void RemoveAt(int i)
        {
            int j = 0;
            DoubleLinkedNode <T> p = head;
            DoubleLinkedNode <T> q = head.Next;

            while (q != null)
            {
                if (i == j)
                {
                    p.Next         = q.Next;
                    (p.Next).Prior = p;
                    return;
                }
                p = q;
                q = q.Next;
                j++;
            }
            throw new IndexOutOfRangeException("Index Out Of Range Exception in " + this.GetType());
        }
示例#2
0
 public DoubleLinkedNode()
 {
     prior = next = null;
 }
示例#3
0
 public DoubleLinkedList()
 {
     head = new DoubleLinkedNode <T>();            // 指向作为标志的头节点
 }
示例#4
0
 public DoubleLinkedNode(T k)
 {
     item  = k;
     prior = next = null;
 }