标签:完成 return max == 遍历 访问 nil else 开始


func maxDepth(root *TreeNode) int {
    if root == nil {
        return 0
    }
    lhight := maxDepth(root.Left)
    rhight := maxDepth(root.Right)
    return max(lhight, rhight) + 1
}
func max(x int, y int) int {
    if x > y {
        return x
    }else {
        return y
    }
}
标签:完成 return max == 遍历 访问 nil else 开始
原文地址:https://www.cnblogs.com/juice-e/p/13353911.html