예제 #1
0
        public void MaxDepthTest()
        {
            var solution = new _104_MaximumDepthOfBinaryTree();
            var result   = solution.MaxDepth(TestHelper.GenerateTree(new int?[] { 3, 9, 20, null, null, 15, 7 }));

            Assert.AreEqual(3, result);
        }
예제 #2
0
        public void MaxDepthTest_Null()
        {
            var solution = new _104_MaximumDepthOfBinaryTree();
            var result   = solution.MaxDepth(null);

            Assert.AreEqual(0, result);
        }