111. Minimum Depth of Binary Tree
来源:互联网 发布:ppt录制旁白软件 编辑:程序博客网 时间:2024/06/10 05:01
public class Solution {
public int minDepth(TreeNode root) {
if(root==null)return 0;
int l=minDepth(root.left);
int r=minDepth(root.right);
if(l==0||r==0)return l+r+1;
return Math.min(l,r)+1;
}
}
public int minDepth(TreeNode root) {
if(root==null)return 0;
int l=minDepth(root.left);
int r=minDepth(root.right);
if(l==0||r==0)return l+r+1;
return Math.min(l,r)+1;
}
}
0 0
- LeetCode 111. Minimum Depth of Binary Tree
- [LeetCode]111.Minimum Depth of Binary Tree
- 【LeetCode】111.Minimum Depth of Binary Tree
- [Leetcode] 111. Minimum Depth of Binary Tree
- 111.Minimum Depth of Binary Tree
- 111. Minimum Depth of Binary Tree
- [leetcode] 111. Minimum Depth of Binary Tree
- 111. Minimum Depth of Binary Tree
- 111. Minimum Depth of Binary Tree
- 111. Minimum Depth of Binary Tree
- 111. Minimum Depth of Binary Tree LeetCode
- 111. Minimum Depth of Binary Tree
- 111. Minimum Depth of Binary Tree
- 【LeetCode】111. Minimum Depth of Binary Tree
- 111. Minimum Depth of Binary Tree
- 111. Minimum Depth of Binary Tree
- LeetCode *** 111. Minimum Depth of Binary Tree
- 111. Minimum Depth of Binary Tree
- CSS Sprites的原理和使用(雪碧图)
- CSDN-Markdown语法
- storm单词计数实例
- 获取edu邮箱
- UIViewContentMode 图片显示模式
- 111. Minimum Depth of Binary Tree
- 88. Merge Sorted Array
- 今天需要修改学习的任务
- 几种任务调度的 Java 实现方法与比较
- 编程与编码
- Java并发编程:深入剖析ThreadLocal
- 使用Handler子线程向主线程通信方式及源码解析
- 矩形嵌套(最小字典序)—DAG动态规划问题
- 如何获取EDU邮箱