예제 #1
0
            public void Add(T value)
            {
                int compare = value.CompareTo(Value);

                if (compare < 0)
                {
                    if (LeftHand == null)
                    {
                        LeftHand = new AVLTreeNode(value, AVLTree)
                        {
                            Parent = this
                        };

                        LeftHand.Reconstruct(true);
                    }
                    else
                    {
                        LeftHand.Add(value);
                    }
                }
                else
                {
                    if (RightHand == null)
                    {
                        RightHand = new AVLTreeNode(value, AVLTree)
                        {
                            Parent = this
                        };

                        RightHand.Reconstruct(true);
                    }
                    else
                    {
                        RightHand.Add(value);
                    }
                }
            }