Maximum Depth of Binary Tree
来源:互联网 发布:adobe 软件 停止工作 编辑:程序博客网 时间:2024/04/30 13:51
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.
int maxDepth(TreeNode *root) { if (root == NULL) return 0; return max(maxDepth(root->left), maxDepth(root->right)) + 1; }
- 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
- IOS开发之UIController生命周期
- Hadoop 1.x(单namenode)版本中默认端口介绍
- 指针和链式结构
- 练习4.1 E2 解答
- 自己写的STM32 内存管理 实现了malloc,free,remalloc等函数
- Maximum Depth of Binary Tree
- 第88天,89天的交易(2013-9-4)(2013-9-5)(-50)(+50)(159.77)(数据单总盈利:-52.65)(贵金属总盈利:-410)
- 指针的用法总结
- register_sysctl_table实现内核数据交互
- 浅谈移动互联网的入口
- 【Cocos2d-X游戏实战开发】捕鱼达人之单例对象的设计(二)
- SQLPLUS常用命令
- win7下配置JDK环境变量
- ORA-01034: ORA-27101: ORA-28056 问题解决办法