int getdepth(BTNode *p) { int ld,rd; if(p==NULL) { return 0; } else { ld=getdepth(p->lchild); rd=getdepth(p->rchild); return (ld>rd?ld:rd)+1; } }