已知二叉链表的类型定义如下:typedef struct btnode{DataType data;struct btnode*

已知二叉链表的类型定义如下:
typedef struct btnode
{DataType data;
struct btnode*lchild。*rchild;
}*BinTree;
利用二叉树遍历的递归算法,设计求二叉树的高度的算法Height(BinTree bt)。
【正确答案】:【答案】
int Height(BinTree bt)
{
int lh. rh;
if(bt == NULL) return 0;
else
{lh= Height{bt->lchild);
rh= Height{bt->rchild};
rerurn i +(lh>rh ? lh : rh);
}
}