摘要:
/** * Definition for a binary tree node. * struct TreeNode { * int val; * struct TreeNode *left; * struct TreeNode *right; * }; */ /* 对于一个公共祖先(一定有子节点才 阅读全文
摘要:
int maxDepth(struct TreeNode* root){ if (root == NULL) { return 0; } int lenLeft = maxDepth(root->left) + 1; int lenRight = maxDepth(root->right) + 1; 阅读全文