/*struct TreeNode {
int val;
struct TreeNode *left;
struct TreeNode *right;
TreeNode(int x) :
val(x), left(NULL), right(NULL) {
}
};*/
class Solution {
public:
int max = 0;
void TreeDepth(TreeNode* pRoot,int depth)
{
if(max < depth)
max = depth;
if(pRoot->left != NULL)
TreeDepth(pRoot->left,depth+1);
if(pRoot->right != NULL)
TreeDepth(pRoot->right,depth+1);
}
int TreeDepth(TreeNode* pRoot)
{
if(pRoot == NULL)
return 0;
TreeDepth(pRoot,1);
return max;
}
};