#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
struct TreeNode {
int val;
struct TreeNode *left;
struct TreeNode *right;
};
int max(int a,int b)
{
if(a>=b)
return a;
else
{
return b;
}
}
int maxDepth(struct TreeNode* root){
if(root==NULL)
return 0;
return max(maxDepth(root->left),maxDepth(root->right))+1;
}
int main()
{
struct TreeNode *left1=NULL;
maxDepth(left1);
return 0;
}
11-30
1762
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)