question:
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.
解题思路: 递归求解,返回较大深度
int maxDepth(TreeNode* root) {
if(root == NULL)
return 0;
int l = maxDepth(root -> left);
int r = maxDepth(root -> right);
if(l > r)
return l + 1;
else
return r + 1;
}