public void GetSizeOfTree() { BinaryTree <int> tree = new BinaryTree <int>(); tree.Root = new BinaryTreeNode <int>(1); tree.Root.Left = new BinaryTreeNode <int>(2); tree.Root.Right = new BinaryTreeNode <int>(3); tree.Root.Left.Left = new BinaryTreeNode <int>(4); tree.Root.Left.Right = new BinaryTreeNode <int>(5); Assert.AreEqual(5, tree.Size()); }
public void GetSizeOfEmptyTree() { BinaryTree <int> tree = new BinaryTree <int>(); Assert.AreEqual(0, tree.Size()); }