@DanielFischer I tried the following:
Height(T,K){
if (T==NULL) return;
pointer R;
R=LookUp(T,K);
int k=height(R);
return k;
}
height(pointer R){
static j=0,l=0;
if (R==NULL) return 0;
if (R->lc!=NULL) l=1+height(R->lc);
if (R->rc!=NULL) j=l-height(R->lc)+height(R->rc);
if (R->rc==NULL and R->lc==NULL) return 1;
return max(l,j);
}