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