//(1)如果二叉树为空,二叉树的深度为0
//(2)如果二叉树不为空,二叉树的深度 = max(左子树深度, 右子树深度) + 1
int getDepth(BinaryTree* pRoot)
{
if(pRoot==NULL)
return 0;
int leftDepth = getDepth(pRoot->left);
int rightDepth = getDepth(pRoot->right);
return leftDepth>rightDepth?(leftDepth+1):(rightDepth+1);
}