int maxDepth(struct TreeNode* root){
if (root == NULL) {
return 0;
}
int lenLeft = maxDepth(root->left) + 1;
int lenRight = maxDepth(root->right) + 1;
return lenLeft > lenRight ? lenLeft : lenRight;
}
int maxDepth(struct TreeNode* root){
if (root == NULL) {
return 0;
}
int lenLeft = maxDepth(root->left) + 1;
int lenRight = maxDepth(root->right) + 1;
return lenLeft > lenRight ? lenLeft : lenRight;
}