[LeetCode] Minimum Depth of Binary Tree
来源:互联网 发布:ubuntu wine 使用 编辑:程序博客网 时间:2024/06/06 06:33
class Solution {public: int minDepth(TreeNode *root) { if(root == NULL) return 0; if(root -> left == NULL) return minDepth(root -> right) + 1; if(root -> right == NULL) return minDepth(root -> left) + 1; return min((minDepth(root -> left) + 1),(minDepth(root -> right) + 1)); }};
0 0
- LeetCode: Minimum Depth of Binary Tree
- [Leetcode] Minimum Depth of Binary Tree
- LeetCode : Minimum Depth of Binary Tree
- leetcode 31: Minimum Depth of Binary Tree
- [LeetCode] Minimum Depth of Binary Tree - BFS
- [LeetCode] Minimum Depth of Binary Tree - DFS
- 【leetcode】Minimum Depth of Binary Tree
- LeetCode:Minimum Depth of Binary Tree
- [LeetCode]Minimum Depth of Binary Tree
- [Leetcode]Minimum Depth of Binary Tree
- [leetcode]Minimum Depth of Binary Tree
- Leetcode: Minimum Depth of Binary Tree
- LeetCode-Minimum Depth of Binary Tree
- [leetcode] Minimum Depth of Binary Tree
- LeetCode - Minimum Depth of Binary Tree
- 【Leetcode】Minimum Depth of Binary Tree
- LeetCode | Minimum Depth of Binary Tree
- LeetCode - Minimum Depth of Binary Tree
- 常见TPEE 弹性体性能及加工工艺特点
- skia : --- SkImageDecoder::Factory returned null
- 网络编程 TCP 的那些事儿一
- 做一个有主见的女生
- OpenGL 矩阵变换(讲的太好了~!)
- [LeetCode] Minimum Depth of Binary Tree
- FreeMarker标签介绍:表达式及常用指令
- java线程阻塞中断和LockSupport的常见问题
- JAVA自定义数组工具类
- 单元测试一个ZF2应用程序
- PX与DIP互转
- hadoop、hbase、zookeeper整合kerberos,搭建安全平台
- 索尼公司发布第二财季财报:亏损7.85亿美元
- Android图片处理(Matrix,ColorMatrix)