2019-07-27 |

求最大树深

A
B
C
D
答案:
def maxDepth(root):
    if not root:
        return 0
    return max(maxDepth(root.left), maxDepth(root.right)) + 1

解释:

0

剑指offer

发表评论

    评价:
    验证码: 点击我更换图片
    最新评论