class Solution {
public:
int TreeDepth(TreeNode* pRoot)
{
if( !pRoot )
return0;
int left = TreeDepth(pRoot->left);
int right = TreeDepth(pRoot->right);
return left > right ? ( left + 1 ) : ( right + 1 );
}
};
posted on
2017-03-01 01:21123_123
阅读(82)
评论(0)
编辑收藏举报