C++ Leetcode 111Minimum Depth of Binary Tree
来源:互联网 发布:视频滚动字幕制作软件 编辑:程序博客网 时间:2024/06/06 20:19
class Solution {public: int minDepth(TreeNode* root) { if(root == 0) return 0; int depth ; if(root!=0) { depth = 1; int L = minDepth(root->left); int R = minDepth(root->right); if(L && R) { int min = R>L?L:R; depth += min; } else if(L == 0) depth+= R; else if(R== 0) depth += L; } return depth; }};
1 0
- [leetcode-111]Minimum Depth of Binary Tree(C语言)
- 【leetcode c++】111 Minimum Depth of Binary Tree
- 【LeetCode-111】Minimum Depth of Binary Tree(C++)
- LeetCode(111)Minimum Depth of Binary Tree
- LeetCode: Minimum Depth of Binary Tree [111]
- 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
- 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
- [MED]Summary of Methods used in MED task(TRECVID 2015)
- poj1722 SUBTRACT
- list.index()
- velocity 新手入门
- C++ primer
- C++ Leetcode 111Minimum Depth of Binary Tree
- React学习笔记---生产周期方法
- 小结struts2应用开发步骤和流程(三)
- 一个Activity管理多个Fragment切换
- MyEclipse做的项目导入到Eclipse中错误
- Android动画最新最全详解包含Material Design动画
- 瑞昱RTL8710对标乐鑫ESP8266 谁将成为物联网首选-新版
- QT基础(二)----鼠标、键盘事件处理机制、信息拦截机制
- ERROT: SampleCB() - buffer sizes do not match 解决方案