コード例 #1
0
ファイル: LinkedList.cs プロジェクト: PascalKiers19/INF2D
        /// 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
ファイル: LinkedList.cs プロジェクト: PascalKiers19/INF2D
        /// 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
ファイル: LinkedList.cs プロジェクト: PascalKiers19/INF2D
 /// Constructor for the DoublyNode accepting an object
 public DoublyNode(Object theElement)
 {
     Element = theElement;
     Flink   = null;
     Blink   = null;
 }
コード例 #4
0
ファイル: LinkedList.cs プロジェクト: PascalKiers19/INF2D
 /// Constructor for the DoublyNode
 public DoublyNode()
 {
     Element = null;
     Flink   = null;
     Blink   = null;
 }