예제 #1
0
        public void CanStoreDefaultValueOfT()
        {
            var tree = BinaryTree.Create(1, 0, 2);

            CollectionAssert.AreEqual(new[] { 0, 1, 2 }, tree);
        }
예제 #2
0
        public void InitializeFromAnArrayAndSort2()
        {
            var tree = BinaryTree.Create(2, 4, 1, 7, 3, 9, 5, 6, 8);

            CollectionAssert.AreEqual(new[] { 1, 2, 3, 4, 5, 6, 7, 8, 9 }, tree);
        }
예제 #3
0
 public static BinaryTree <T> Create(T[] array, BinaryTree <T> tree)
 {
     return(new BinaryTree <T>());
 }
예제 #4
0
 public BinaryTree()
 {
     Head = this;
     // Value = default(TParametrs);
 }
 public void Reset()
 {
     CurrentNode = new BinaryTree <T>();
 }
 public BinaryTreeEnumerator(BinaryTree <T> node)
 {
     this.OriginalTree = node ?? throw new Exception();
     //this.CurrentNode = new BinaryTree<T>();
     this.CurrentNode = null;
 }