Leetcode 111. Minimum Depth of Binary Tree
来源:互联网 发布:淘宝卖家物流费用标准 编辑:程序博客网 时间:2024/06/13 02:14
public class Solution { public int minDepth(TreeNode root) { if (root == null) return 0; // take care of the trees that only have left or right child if (root.left == null) return minDepth(root.right) + 1; if (root.right == null) return minDepth(root.left) + 1; return Math.min(minDepth(root.left), minDepth(root.right)) + 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
- [leetcode] 111. Minimum Depth of Binary Tree
- 111. Minimum Depth of Binary Tree LeetCode
- 【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
- 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.[Leetcode]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
- 部分常用sql,适用于oracle
- android listView 深入探讨
- C#学习笔记一 基础知识点整理
- Java动态类加载器(加载外部jar包类 读取资源文件)
- linux上同步文件夹
- Leetcode 111. Minimum Depth of Binary Tree
- 移动客户端中高效使用 SQLite
- 数据当中含有双引号,用jstl表达式为表单赋值时出错
- php通过PO连接SAP的接口
- linux获取/查看本机出口ip
- JS自定义事件的定义和触发(createEvent, dispatchEvent)
- Centos - 重装git
- 图像在MindManager中能起到什么作用
- AR 移动端手指缩放