题解 | #二叉树的最大深度#
二叉树的最大深度
https://www.nowcoder.com/practice/8a2b2bf6c19b4f23a9bdb9b233eefa73
int maxDepth(TreeNode* root) { // write code here int m,n;//保存左右子树的深度 if(root==nullptr) return 0; else{ m=maxDepth(root->left); n=maxDepth(root->right); if(m>n) return (m+1); else return (n+1); } }简单题