Ejemplo n.º 1
0
        public void Add(T value)
        {
            if (LeftChild == null)
            {
                LeftChild = new DemoTree <T>(value);
                return;
            }

            if (RightChild == null)
            {
                RightChild = new DemoTree <T>(value);
                return;
            }

            if (LeftChild.Depth() <= RightChild.Depth())
            {
                LeftChild.Add(value);
                return;
            }

            RightChild.Add(value);
        }
Ejemplo n.º 2
0
 public DemoTreeEnumerator(DemoTree <T> tree)
 {
     Tree = tree;
 }