104. Maximum Depth of Binary Tree
来源:互联网 发布:c语言数组定义不加数字 编辑:程序博客网 时间:2024/05/20 23:26
Given a binary tree, find its maximum depth.
The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.
class Solution {public: int maxDepth(TreeNode* root) { if(!root) return 0; int HLtree=maxDepth(root->left); int Hrtree=maxDepth(root->right); return HLtree>Hrtree?HLtree+1:Hrtree+1; }};
0 0
- [LeetCode]104.Maximum Depth of Binary Tree
- 104.Maximum Depth of Binary Tree
- 【LeetCode】104.Maximum Depth of Binary Tree
- [Leetcode] 104. Maximum Depth of Binary Tree
- LeetCode --- 104. Maximum Depth of Binary Tree
- LeetCode 104. Maximum Depth of Binary Tree
- 104.Maximum Depth of Binary Tree
- 104. Maximum Depth of Binary Tree
- 104.Maximum Depth of Binary Tree
- 104. Maximum Depth of Binary Tree
- 104. Maximum Depth of Binary Tree
- leetCode 104. Maximum Depth of Binary Tree
- 104. Maximum Depth of Binary Tree
- 104. Maximum Depth of Binary Tree LeetCode
- 104. Maximum Depth of Binary Tree LeetCode
- 104. Maximum Depth of Binary Tree
- LeetCode 104. Maximum Depth of Binary Tree
- leetcode:104. Maximum Depth of Binary Tree
- R语言并行计算编程
- Android:Layout_weight的深刻理解
- 设置百度地图的缩放比例
- JS实现倒计时三秒跳转后到新页面
- Android快速开发工具类之DownloadManagerPro
- 104. Maximum Depth of Binary Tree
- Hadoop存在巨大数据安全风险的十个理由
- bzoj3533
- 解决CocoaPods各种慢的方案(gem换源+pod repo换源)
- C#简单内容
- 从零开始:用Python搭建神经网络
- LeetCode 136 Single Number题解
- 用python进行简单欧式期权定价
- 欢迎使用CSDN-markdown编辑器