public void DepthZeroReturnRootNode() { Tree tree = CreateTree(3); TreeSearch search = new TreeSearch(); Assert.AreEqual(3, search.FindMaxValue(tree, 0)); }
public void DepthZeroOnTreeWithChildren() { Tree tree = CreateTree(5, 3, 7); TreeSearch search = new TreeSearch(); Assert.AreEqual(5, search.FindMaxValue(tree, 0)); }
public void DepthTwoOnTreeWithTwoLevelsOfChildren() { Tree tree = CreateTreeNodes(5, CreateTree(3, 5, 7), CreateTree(7, 9, 11)); TreeSearch search = new TreeSearch(); Assert.AreEqual(11, search.FindMaxValue(tree, 2)); }
public void DepthOneReturnRootNodeOnTreeWithoutChildren() { Tree tree = CreateTree(5); TreeSearch search = new TreeSearch(); Assert.AreEqual(5, search.FindMaxValue(tree, 1)); }
public void DepthOneOnTreeWithOnlyTwoChildren() { Tree tree = CreateTree(5, 3, 7); TreeSearch search = new TreeSearch(); Assert.AreEqual(7, search.FindMaxValue(tree, 1)); }
public void DepthOneOnTreeWithOnlyOneChild() { Tree tree = CreateTree(5, 3); TreeSearch search = new TreeSearch(); Assert.AreEqual(3, search.FindMaxValue(tree, 1)); }