返回首页
二叉树的最大深度
LeetCode Hot 100
二叉树
难度:
简单
题目描述
计算二叉树的最大深度。
解题思路
使用递归,深度等于左子树和右子树最大深度加 1。时间复杂度为 O(n)。