예제 #1
0
        internal void method_1()
        {
            if (this.method_3(this.node_0, true, 0) == 0)
            {
                throw new Exception("Invalid tree.");
            }
            if (this.node_0 == null)
            {
                return;
            }
            if (this.node_0.Parent != null)
            {
                throw new Exception("root.Parent should be null.");
            }
            RedBlackTree <T> .ForwardEnumerator forwardEnumerator = new RedBlackTree <T> .ForwardEnumerator(this);

            while (forwardEnumerator.MoveNext())
            {
                forwardEnumerator.CurrentNode.method_3();
            }
        }
예제 #2
0
        internal void method_2(out bool isInvalidTree, out bool rootParentNotNull)
        {
            isInvalidTree     = false;
            rootParentNotNull = false;
            if (this.method_3(this.node_0, true, 0) == 0)
            {
                isInvalidTree = true;
            }
            if (this.node_0 == null)
            {
                return;
            }
            if (this.node_0.Parent != null)
            {
                rootParentNotNull = true;
            }
            RedBlackTree <T> .ForwardEnumerator forwardEnumerator = new RedBlackTree <T> .ForwardEnumerator(this);

            while (forwardEnumerator.MoveNext())
            {
                forwardEnumerator.CurrentNode.method_3();
            }
        }