Example #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;
            }
        }
Example #2
0
 public Tree(IDent dent, int deep)
 {
     ident = dent;
     //x = deep;
 }
Example #3
0
 public Tree(IDent dent)
 {
     ident = dent;
 }