maximum-depth-of-binary-tree Java code
来源:互联网 发布:淘宝丰胸产品有用吗 编辑:程序博客网 时间:2024/06/12 13:16
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.
/** * 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(root == null) return 0; return 1 + Math.max(maxDepth(root.left), maxDepth(root.right)); }}
阅读全文
0 0
- maximum-depth-of-binary-tree Java code
- CODE 29: Maximum Depth of Binary Tree
- [leet code]Maximum Depth of Binary Tree
- Maximum Depth of Binary Tree (Leet Code)
- [Leetcode] Maximum Depth of Binary Tree (Java)
- Maximum Depth of Binary Tree(java version)
- Maximum Depth of Binary Tree (Java)
- [LeetCode][Java] Maximum Depth of Binary Tree
- Maximum Depth of Binary Tree Java
- LeetCode|Maximum Depth of Binary Tree-java
- (java)leetcode Maximum Depth of Binary Tree
- leetcode:Maximum Depth of Binary Tree 【Java】
- minimum-depth-of-binary-tree java code
- leetcode 日经贴,Cpp code -Maximum Depth of Binary Tree
- Leet Code 104. Maximum Depth of Binary Tree
- Maximum Depth of Binary Tree
- Maximum Depth of Binary Tree
- Maximum Depth of Binary Tree
- 热衷于编程,做的一直都很认真
- GitHub托管HTML页面,让其他人轻松访问自己的页面
- SSM框架整合配置文件整理
- A. Trip For Meal
- 实验四 十进制转二进制
- maximum-depth-of-binary-tree Java code
- 深度 | Y Combinator成长史
- 微信公众平台新增定时群发功能
- 70+公司12大领域,尽览无人机生态全景
- 揭密 | 初代iPhone真正诞生的前6个月
- 国内已有Petya感染用户成功恢复部分文档!
- 守护者观察|色情诱导诈骗:20秒小电影撑起6亿黑产
- 工信部:明日起手机预装软件必须可卸载
- 24.2亿欧元!欧盟对谷歌处以“创纪录”的反垄断罚款