예제 #1
0
        public static void GetKeysInOrder_MultipleKeys_ReturnsAllKeysInCorrectOrder()
        {
            var tree = new BinarySearchTree <int>();

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

            var keys     = tree.GetKeysInOrder();
            var expected = new List <int> {
                2, 3, 4, 5, 6, 7, 8
            };

            Assert.IsTrue(keys.SequenceEqual(expected));
        }