Beispiel #1
0
        public void TestAttachChild()
        {
            _tree.InsertAsRoot(0);
            _tree.InsertAsLc(_tree.Root, 1);
            _tree.InsertAsRc(_tree.Root, 2);
            //new tree
            var newTree = new BinTree <int>();

            newTree.InsertAsRoot(5);
            _tree.AttachAsLc(_tree.Root, newTree);
            Assert.AreEqual(_tree.Size, 3);
            Assert.AreEqual(_tree.Root.LChild.Data, 5);
        }