标签:style class blog code color for
/** * Definition for binary tree * 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 dl = maxDepth(root->left); int dr = maxDepth(root->right); return max(dl, dr) + 1; } };
不能更水
LeetCode Maximum Depth of Binary Tree,布布扣,bubuko.com
LeetCode Maximum Depth of Binary Tree
标签:style class blog code color for
原文地址:http://www.cnblogs.com/lailailai/p/3805990.html