Maximum Depth of Binary Tree
来源:互联网 发布:home软件下载 编辑:程序博客网 时间:2024/06/05 18:31
/** * Definition for binary tree * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { val = x; } * } */public class Solution { public int maxDepth(TreeNode root) { if(null == root) return 0; return Math.max(maxDepth(root.left), maxDepth(root.right))+1; }}
0 0
- Maximum Depth of Binary Tree
- Maximum Depth of Binary Tree
- Maximum Depth of Binary Tree
- Maximum Depth of Binary Tree
- Maximum Depth of Binary Tree
- Maximum Depth of Binary Tree
- Maximum Depth of Binary Tree
- Maximum Depth of Binary Tree
- Maximum Depth of Binary Tree
- Maximum Depth of Binary Tree
- Maximum Depth of Binary Tree
- Maximum Depth of Binary Tree
- Maximum Depth of Binary Tree
- Maximum Depth of Binary Tree
- Maximum Depth of Binary Tree
- Maximum Depth of Binary Tree
- Maximum Depth of Binary Tree
- Maximum Depth of Binary Tree
- Java内存与垃圾回收调优
- 物联网开源软件
- 数据结构学习笔记
- 剖析cmd >file 2>&1 和 cmd >file 2>file 的差别
- javascript常用对象的源码--Array用法
- Maximum Depth of Binary Tree
- 重定向详解
- Android之Adapter用法总结
- axis1.4+eclipse+tomcat7.0创建简单webservice(大神绕道啊啊)
- Linux下如何编译并运行C程序
- Android连接蓝牙打印机实现PDF文档的打印
- MKL/VSL,vRngGaussian:生成高斯分布随机数
- CentOS 添加用户到sudoers
- 自绘控件时添加LBS_OWNERDRAWFIXED风格,离奇报错的解决方案!