示例#1
0
        /// Removes an object
        public void Remove(Object n)
        {
            DoublyNode p = Find(n);

            if (!(p.Flink == null))
            {
                p.Blink.Flink = p.Flink;
                p.Flink.Blink = p.Blink;
                p.Flink       = null;
                p.Blink       = null;
            }
        }
示例#2
0
        /// Finds an object in the DoublyLinkedList and returns the DoublyNode
        private DoublyNode Find(Object item)
        {
            DoublyNode current = new DoublyNode();

            current = header;

            while (header != item)
            {
                current = current.Flink;
            }
            return(current);
        }
示例#3
0
 /// Constructor for the DoublyNode accepting an object
 public DoublyNode(Object theElement)
 {
     Element = theElement;
     Flink   = null;
     Blink   = null;
 }
示例#4
0
 /// Constructor for the DoublyNode
 public DoublyNode()
 {
     Element = null;
     Flink   = null;
     Blink   = null;
 }