Example #1
0
        public void StressTestForGetMinimum()
        {
            RedBlackTreeWithIndexAccess tree = new RedBlackTreeWithIndexAccess();

            for (int i = 0; i < 1000000; i++)
            {
                tree.RB_Insert(new TestObject(4));
            }
            tree.RB_Insert(new TestObject(1));
            RBNodeIndexAccess node = null;
            int key = 0;

            while (key != 1)
            {
                node = tree.GetMinimumNode();
                key  = ((TestObject)node.Key)._value;
                tree.RB_Delete(node);
            }
        }