Beispiel #1
0
        public void BinaryTree_RemoveTest()
        {
            var tree = new AVLBinaryTree <int>();

            for (var i = 0; i < 10; i++)
            {
                tree.Add(i);
            }

            tree.Remove(5);

            CollectionAssert.AreEqual(tree.Inorder()
                                      .ToArray(),
                                      new[]
            {
                0,
                1,
                2,
                3,
                4,
                6,
                7,
                8,
                9
            });
        }
Beispiel #2
0
        public void Remove_AVLTree()
        {
            using var tree = new AVLBinaryTree <int>
                  {
                      1,
                      2
                  };

            tree.Remove(1);
        }