Example #1
0
        public void BalanceLeftTest()
        {
            var avl = new AVLTree <int>
            {
                6, 16, 19, 11, 10
            };

            avl.Remove(11);
            var actual = new AVLTree <int> {
                16
            };

            Assert.AreEqual(avl.Head.Value, actual.Head.Value);
        }
Example #2
0
        public void RemoveTest()
        {
            var avl0 = new AVLTree <int>
            {
                1, 2, 3, 4, 5
            };

            avl0.Remove(1);
            var avl1 = new AVLTree <int>
            {
                5, 4, 3, 2
            };

            CollectionAssert.AreEqual(avl0, avl1);
        }
Example #3
0
        static void Main()
        {
            var avl = new AVLTree <int>
            {
                30,
                4,
                9,
                8,
                7,
                11,
                12,
                14
            };

            avl.Remove(12);

            foreach (var item in avl)
            {
                Console.WriteLine(item);
            }
        }