题解 | #二叉树的最大深度#
二叉树的最大深度
https://www.nowcoder.com/practice/8a2b2bf6c19b4f23a9bdb9b233eefa73
int find(struct TreeNode* root) { if(!root) return 0; int leftdepth=find(root->left); int rightdepth=find(root->right); return (leftdepth>rightdepth?leftdepth:rightdepth)+1; } int maxDepth(struct TreeNode* root ) { return find(root); }