104. Maximum Depth of Binary Tree
来源:互联网 发布:java微信商城开源 编辑:程序博客网 时间:2024/06/05 09:54
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.
int maxDepth(struct TreeNode* root) {int LH = 0, RH = 0, H = 0;if (!root)return 0;else{LH = maxDepth(root->left);RH = maxDepth(root->right);H = ((LH > RH) ? LH : RH);return H + 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
- [LeetCode]83. Remove Duplicates from Sorted List
- HBase中正则过滤表达式与JAVA正则表达式不一致问题的分析和解决
- Ubuntu下su:authentication failure的解决办法
- 优雅的加权并差集
- mmu的理解(一)
- 104. Maximum Depth of Binary Tree
- iOStextField限制输入框长度,包括判断汉字总
- oracle 一些命中率
- camera 原理
- JS appendChild和insertBefore
- spark JVM调优之调节executor堆外内存与连接等待时长
- 原码 反码 补码
- CodeForces-719B Anatoly and Cockroaches(思维题)
- java 多线程