Leetcode: Maximum Depth of Binary Tree
来源:互联网 发布:淘宝旺旺mac版 编辑:程序博客网 时间:2024/06/13 09:54
http://oj.leetcode.com/problems/maximum-depth-of-binary-tree/
/** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */#include<algorithm>using namespace std;class Solution {public: int maxDepth(TreeNode *root) { // Start typing your C/C++ solution below // DO NOT write int main() function if(root==NULL) return 0; return max(maxDepth(root->left),maxDepth(root->right))+1; }};
- 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
- asdasd
- LeetCode题解:Two Sum
- Use thrust reduce_by_key with raw pointers instead of device pointers
- Leetcode: Best Time to Buy and Sell Stock II
- Leetcode: Same Tree
- Leetcode: Maximum Depth of Binary Tree
- Leetcode: Reverse Integer
- Leetcode: Symmetric Tree
- Leetcode: Merge Sorted Array
- Leetcode: Climbing Stairs
- Leetcode: Remove Duplicates from Sorted List
- Leetcode: Search Insert Position
- Leetcode: Remove Duplicates from Sorted Array
- JS限制textbox或textarea输入字符长度