
计算二叉树的最大深度,递归解法,分别计算左右子树的最大深度,递归出口为到达叶子结点。
Given a binary tree, find its maximum depth.
The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.
1 |
|
传送门:leetcode104

计算二叉树的最大深度,递归解法,分别计算左右子树的最大深度,递归出口为到达叶子结点。
Given a binary tree, find its maximum depth.
The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.
1 |
|
传送门:leetcode104
近期评论