public void TestSize() { var bst = new BinarySearchTree<char, int>(); Assert.AreEqual(0, bst.Size()); bst.Put('A', 1); Assert.AreEqual(1, bst.Size()); Assert.AreEqual(_result.Length, CreateBST().Size()); }
private static BinarySearchTree<string, int> CreateBST() { ; var result = new BinarySearchTree<string, int>(StringComparer.Ordinal); for (int i = 0; i < _fixture.Length; i++) { result.Put(_fixture[i], i); } return result; }
public void TestIsEmpty() { var bst = new BinarySearchTree<char, int>(); Assert.True(bst.IsEmpty()); bst.Put('A', 1); Assert.False(bst.IsEmpty()); }