class Solution { public: int TreeDepth(TreeNode* pRoot) { if(pRoot == NULL) return 0; int depth,left,right; left = TreeDepth(pRoot->left); right = TreeDepth(pRoot->right); depth = left > right ? left+1 : right+1; return depth; } };