# 104. Maximum Depth of Binary Tree

/**
* Definition for a binary tree node.
* struct TreeNode {
*     int val;
*     TreeNode *left;
*     TreeNode *right;
*     TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
int maxDepth(TreeNode* root) {
if(root==NULL)
return 0;
int leftD=maxDepth(root->left);
int rightD=maxDepth(root->right);
return leftD>=rightD?leftD+1:rightD+1;
}
};

#### 104. Maximum Depth of Binary Tree [easy] (Python)

2016-05-07 13:21:08

#### leetcode 104 Maximum Depth of Binary Tree二叉树求深度

2015-05-13 22:16:12

#### Maximum Depth of Binary Tree -- LeetCode

2014-02-22 03:34:51

#### 【LeetCode-面试算法经典-Java实现】【104-Maximum Depth of Binary Tree（二叉树的最大深度）】

2015-08-08 06:43:32

#### Minimum Depth of Binary Tree -- LeetCode

2014-02-22 03:52:34

#### maximum-depth-of-binary-tree(二叉树的最大深度)

2016-09-07 20:55:45

#### LeetCode104——Maximum Depth of Binary Tree

2015-02-05 15:29:44

#### Given a binary tree, find its maximum depth.

2014-05-23 14:21:31

#### 【LeetCode】【Python题解】Single Number & Maximum Depth of Binary Tree

2014-07-20 13:18:24

#### Given a binary tree, find its minimum depth.The minimum depth is the number of nodes along the short

2018-04-21 16:21:13