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即为所求
1 | /** |
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即为所求
1 | /** |