LeetCode-104. Maximum Depth of Binary Tree
来源:互联网 发布:淘宝黛慕名品假货 编辑:程序博客网 时间:2024/05/29 17:33
Maximum Depth of Binary Tree
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 a binary tree node. * function TreeNode(val) { * this.val = val; * this.left = this.right = null; * } *//** * @param {TreeNode} root * @return {number} */var maxDepth = function(root) { return root===null?0:Math.max(maxDepth(root.left),maxDepth(root.right))+1;};
阅读全文
0 0
- [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
- 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
- 面试十大经典问题
- 天下游 安装方法
- Zynq-Linux移植学习笔记之17-Zynq下linuxPL部分Flash
- zookeeper命令行(zkCli.sh&zkServer.sh)使用及四字命令
- 链表中环的入口节点
- LeetCode-104. Maximum Depth of Binary Tree
- Java8 接口默认方法
- OC 和 C 的本质区别
- Python核心编程(第三版)课后习题解答——第二章
- 如何回答才最得体 你会应对这些面试题吗?
- 流程控制
- 如何优化Mysql千万级快速分页,limit优化快速分页,MySQL处理千万级数据查询的优化方案!(zz)
- 如何在各种类型的面试中取胜
- DBCA创建CDB的过程