Ejemplo n.º 1
0
        public void EnumerateBreadthFirstSearch()
        {
            var list = new[] { 2, 3, 5, 6, 9, 10 };
            var avl  = new AVLTree <int>();

            foreach (int i in list)
            {
                avl.Insert(i);
            }

            var orderedSequence = new[] { 6, 3, 9, 2, 5, 10 }.ToList();

            var actualOrdered = avl.BreadthFirstSearch().ToList();

            CollectionAssert.AreEqual(orderedSequence, actualOrdered);
        }