//二叉树节点的表示
struct Node{
int data;Node* leftChild;
Node* rightChild;
};
//返回二叉树的深度
int treeDepth(Node* root){if(root==NULL)
return 0;
else if(root->leftChild==NULL&&root->rightChild==NULL)
return 1;
else{
int ld=0,rd=0;
if(root->leftChild!=NULL)
ld=treeDepth(root->leftChild);
if(root->rightChild!=NULL)
rd=treeDepth(root->rightChild);
if(ld>rd) return ld+1;
else return rd+1;
}}