LC104 - 二叉树的最大深度 MaximumDepth.go 1 2 3 4 5 6 7 8 9 10package BinaryTree func maxDepth(root *TreeNode) int { if root == nil { return 0 } leftRet := maxDepth(root.Left) rightRet := maxDepth(root.Right) return 1 + max(leftRet, rightRet) }