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