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

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

            Assert.AreEqual(8, tree.GetMax() !.Key);
        }
Beispiel #2
0
        public static void GetMax_EmptyTree_ReturnsDefaultValue()
        {
            var tree = new BinarySearchTree <int>();

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