Beispiel #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;
            }
        }
Beispiel #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);
        }
Beispiel #3
0
 /// Constructor for the DoublyNode accepting an object
 public DoublyNode(Object theElement)
 {
     Element = theElement;
     Flink   = null;
     Blink   = null;
 }
Beispiel #4
0
 /// Constructor for the DoublyNode
 public DoublyNode()
 {
     Element = null;
     Flink   = null;
     Blink   = null;
 }