public void ShouldDoNothingInEmptyTree() { var binaryTree = new BinarySearchTreeAvl <int>(); binaryTree.Remove(1); binaryTree.Root.Should().BeNull(); }
public void ShouldDeleteRootWhenIsRoot() { var binaryTree = new BinarySearchTreeAvl <int>(); binaryTree.Add(1); binaryTree.Remove(1); binaryTree.Root.Should().BeNull(); }
public void ShouldRemoveNodeIfIsLeaf() { var binaryTree = new BinarySearchTreeAvl <int>(); binaryTree.Add(1); binaryTree.Add(2); binaryTree.Remove(2); binaryTree.Root.IsLeaf().Should().BeTrue(); }
public void CreateTree() { binaryTree = new BinarySearchTreeAvl <int>(); binaryTree.Add(1, -1, 2, 3); binaryTree.Remove(2); }