Exemplo n.º 1
0
 public void SampleTree_ElementDoesNotExist()
 {
     TreeLowestCommonAncestor.LowestCommonAncestor(_sampleTree, 0, 1).Should().BeNull();
 }
Exemplo n.º 2
0
 public void SampleTree_AllTree()
 {
     TreeLowestCommonAncestor.LowestCommonAncestor(_sampleTree, 50, 1).Value.Should().Be(5);
 }
Exemplo n.º 3
0
 public void SampleTree_2()
 {
     TreeLowestCommonAncestor.LowestCommonAncestor(_sampleTree, 3, 1).Value.Should().Be(2);
 }
Exemplo n.º 4
0
 public void SampleTree_LEafElements()
 {
     TreeLowestCommonAncestor.LowestCommonAncestor(_sampleTree, 30, 50).Value.Should().Be(40);
 }
Exemplo n.º 5
0
 public void Null_Null()
 {
     TreeLowestCommonAncestor.Tree tree = null;
     TreeLowestCommonAncestor.LowestCommonAncestor(tree, 1, 2).Should().BeNull();
 }