104 二叉树的最大深度 class Solution { public: int maxDepth(TreeNode *root) { if(root == nullptr){ return 0; } int left=maxDepth(root->left); int right=maxDepth(root->right); int max_maxDepth=max(left,right)+1; return max_maxDepth; } }; 关于深度优先搜索: