Esempio n. 1
0
        public static void GetKeysPreOrder_MultipleKeys_ReturnsAllKeysInCorrectOrder()
        {
            var tree = new BinarySearchTree <int>();

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

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

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