leetcode 111:二叉树的最小深度

本题也相对简单,只需要简单迭代即可 int minDepth(TreeNode*root){ if(root==NULL) return 0; TreeNode*l=root->left; TreeNode*r=root->right; if(l==NULL&&r==NULL) return 1; else if(l!=NUL
相关文章
相关标签/搜索