示例#1
0
        public void InsertTest()
        {
            var tree = new BinarySearchTree <int>();

            tree.Insert(2);
            tree.Insert(1);
            tree.Insert(3);

            Assert.That(tree.ToArrayInOrder(), Is.EqualTo(new int[] { 1, 2, 3 }));
        }
示例#2
0
        public void ToArrayEmptyTest()
        {
            var tree = new BinarySearchTree <int>();

            Assert.That(tree.ToArrayInOrder(), Is.EqualTo(new int[] { }));
        }
示例#3
0
        public void ToArrayInOrderTest()
        {
            var tree = new BinarySearchTree <int>(new int[] { 1, 2, 3, 4, 5 });

            Assert.That(tree.ToArrayInOrder(), Is.EqualTo(new int[] { 1, 2, 3, 4, 5 }));
        }