题目
题解
class Solution {
public:
int maxDepth(TreeNode* root) {
int maxdepth=0;
if(root==NULL)
{
return 0;
}
else
{
maxdepth=max(maxDepth(root->left),maxDepth(root->right));
return maxdepth+1;
}
}
};