예제 #1
0
        public void Add(IDent dent)
        {
            Tree node = this;

            if (ident != null)
            {
                while (true)
                {
                    if (node.ident.Hash > dent.Hash)
                    {
                        if (node.Left == null)
                        {
                            node.Left = new Tree(dent);
                            return;
                        }
                        else
                        {
                            node = node.Left;
                        }
                    }
                    else
                    if (node.ident.Hash < dent.Hash)
                    {
                        if (node.Right == null)
                        {
                            node.Right = new Tree(dent);
                            return;
                        }
                        else
                        {
                            node = node.Right;
                        }
                    }
                    else
                    {
                        return;
                    }
                }
            }
            else
            {
                ident = dent;
            }
        }
예제 #2
0
 public Tree(IDent dent, int deep)
 {
     ident = dent;
     //x = deep;
 }
예제 #3
0
 public Tree(IDent dent)
 {
     ident = dent;
 }