// A code block
func maxDepth(root *TreeNode) int {
if root == nil { return 0
} else {
left := maxDepth(root.Left)
right := maxDepth(root.Right)
return int(math.Max(float64(left),float64(right)) + 1) }}
11.1
最新推荐文章于 2024-04-11 21:47:04 发布