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