Exemple #1
0
        public static void GetMin_NonEmptyTree_ReturnsCorrectValue()
        {
            var tree = new BinarySearchTree <int>();

            tree.AddRange(new List <int> {
                5, 3, 4, 2, 7, 6, 8
            });

            Assert.AreEqual(2, tree.GetMin() !.Key);
        }
Exemple #2
0
        public static void GetMin_EmptyTree_ReturnsDefaultValue()
        {
            var tree = new BinarySearchTree <int>();

            Assert.IsNull(tree.GetMin());
        }