Beispiel #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);
        }
Beispiel #2
0
 public DemoTreeEnumerator(DemoTree <T> tree)
 {
     Tree = tree;
 }