LeetCode 104. Maximum Depth of Binary Tree java soluiton
来源:互联网 发布:baocms9完整源码 编辑:程序博客网 时间:2024/05/29 13:51
题目要求:
寻找二叉树的最大树深
/** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { val = x; } * } */public class Solution { public int maxDepth(TreeNode root) { if (root == null) { return 0; } int left = maxDepth(root.left); int right = maxDepth(root.right); return Math.max(left, right) + 1; }}
0 0
- LeetCode 104. Maximum Depth of Binary Tree java soluiton
- [Leetcode] Maximum Depth of Binary Tree (Java)
- [LeetCode][Java] Maximum Depth of Binary Tree
- LeetCode|Maximum Depth of Binary Tree-java
- (java)leetcode Maximum Depth of Binary Tree
- leetcode:Maximum Depth of Binary Tree 【Java】
- [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 104. Maximum Depth of Binary Tree
- leetCode 104. Maximum Depth of Binary Tree
- 104. Maximum Depth of Binary Tree LeetCode
- 104. Maximum Depth of Binary Tree LeetCode
- 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
- php xdebug的安装
- 使用Flash烧写工具填充bin文件包头内容
- 字符集和字符编码
- nginx 301转发双反斜杠
- STL学习
- LeetCode 104. Maximum Depth of Binary Tree java soluiton
- ajaxForm和ajaxSubmit 的用法及整理
- 重构的原则
- [生存志] 第127节 子午行流注
- 读《和你在一起就是全世界》
- PO BO VO DTO POJO DAO概念及其作用(转)
- 代码坏味道与重构
- 阿里云Ubuntu16.04下tomcat的安装service及开机自启
- OpenStack L版 neutron server的启动流程 四