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
相關文章
相關標籤/搜索