题目:
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,即为整棵二叉树的最大深度。
代码AC: