示例#1
0
        public void TestCTwoNodeSecondNpl()
        {
            LeftistTree <int> child = new LeftistTree <int>(2, null, null);
            LeftistTree <int> t     = new LeftistTree <int>(5, null, child);

            Assert.That(LeftistTree <int> .NullPathLength(t), Is.EqualTo(1));
        }
示例#2
0
        public void TestEThreeNodeNpl()
        {
            LeftistTree <int> child1 = new LeftistTree <int>(8, null, null);
            LeftistTree <int> child2 = new LeftistTree <int>(3, null, null);
            LeftistTree <int> t      = new LeftistTree <int>(4, child1, child2);

            Assert.That(LeftistTree <int> .NullPathLength(t), Is.EqualTo(2));
        }
示例#3
0
 public void TestBSingleNodeNpl()
 {
     Assert.That(LeftistTree <int> .NullPathLength(new LeftistTree <int>(7, null, null)), Is.EqualTo(1));
 }
示例#4
0
 public void TestAEmptyNpl()
 {
     Assert.That(LeftistTree <string> .NullPathLength(null), Is.EqualTo(0));
 }