LeetCode Maximum Depth of Binary tree
来源:互联网 发布:中科院软件所导师 编辑:程序博客网 时间:2024/06/06 17:00
/** * Definition for a binary tree node. * struct TreeNode { * int val; * struct TreeNode *left; * struct TreeNode *right; * }; */int maxDepth(struct TreeNode* root) { int Dleft,Dright; if(root==NULL) return 0; else{ Dleft=maxDepth(root->left); Dright=maxDepth(root->right); if(Dleft>Dright) return Dleft+1; else return Dright+1; } }C语言 先根遍历。2016/1/28.
0 0
- Leetcode - Tree - Maximum Depth of Binary Tree
- [leetcode][tree] Maximum Depth of Binary Tree
- LeetCode Maximum Depth of Binary Tree
- [Leetcode] Maximum Depth of Binary Tree
- leetcode 24: Maximum Depth of Binary Tree
- [LeetCode] Maximum Depth of Binary Tree
- Leetcode 104 Maximum Depth of Binary Tree
- 【leetcode】Maximum Depth of Binary Tree
- [leetcode]Maximum Depth of Binary Tree
- [LeetCode]Maximum Depth of Binary Tree
- [leetcode]Maximum Depth of Binary Tree
- Leetcode: Maximum Depth of Binary Tree
- LeetCode-Maximum Depth of Binary Tree
- [leetcode] Maximum Depth of Binary Tree
- LeetCode - Maximum Depth of Binary Tree
- LeetCode:Maximum Depth of Binary Tree
- LeetCode | Maximum Depth of Binary Tree
- 【leetcode】Maximum Depth of Binary Tree
- 判断机器是用大端还是用小端方式来表示字节序列
- css限制输入长度
- 数据恢复流程
- ExtJS5 - 实现多表头Grid
- 欢迎使用CSDN-markdown编辑器
- LeetCode Maximum Depth of Binary tree
- 基础算法---冒泡排序法
- Android基础之Menu操作详解
- Tomcat中server.xml配置文件简介
- 产品的版本迭代机制是这样的
- java解析获取Excel中的数据--同时兼容2003及2007
- 前端构建工具gulpjs的使用介绍及技巧
- 文章标题
- 【转】java提高篇(五)-----抽象类与接口