class Solution { public: int treeDepth(TreeNode* root) { if(root==NULL){ return 0; } return max(1+treeDepth(root->left),1+treeDepth(root->right)); } };