摘要:
解法一:递归 1 bool isSameTree(TreeNode* p, TreeNode* q) 2 { 3 if (p == NULL && q == NULL) 4 return true; 5 if ((p == NULL && q != NULL) || ... 阅读全文
摘要:
解法一:递归1 int maxDepth(TreeNode* root)2 {3 if (root == NULL)4 return 0;5 6 int max_left_Depth = maxDepth(root->left);7 int max_right... 阅读全文
摘要:
解法一:From top to bottom 1 int treeHeight(TreeNode *T) 2 { 3 if (T == NULL) 4 return 0; 5 6 return max(treeHeight(T->left), treeHei... 阅读全文