예제 #1
0
        public RedBlackTree <T> .Node TryAdd(T value)
        {
            RedBlackTree <T> .Node node1;
            if (this.node_0 == null)
            {
                this.node_0 = new RedBlackTree <T> .Node(value);

                node1 = this.node_0;
            }
            else
            {
                RedBlackTree <T> .Node node2 = new RedBlackTree <T> .Node(default(T));

                node2.IsRed = false;
                node2.Right = this.node_0;
                node1       = node2.method_4(value, this.icomparer_0);
                this.node_0 = node2.Right;
            }
            this.node_0.IsRed  = false;
            this.node_0.Parent = (RedBlackTree <T> .Node)null;
            if (node1 != null)
            {
                ++this.int_0;
            }
            return(node1);
        }