📄 emp5_12.cpp
字号:
// emp5_12}
#include "btrechar.h"
int hight(bitre t,bptrlink ptr)
{
int h,h1,h2;
if (t==NULL) h=0;
else{
h1=hight(t->lchild,ptr);
h2=hight(t->rchild,ptr);
h=Max(h1,h2)+1;
bptr_point_to(ptr, t);
cur_bnode_onoff(t);
getch();
dispint_atbnode_angle(h,t,0);
cur_bnode_onoff(t);
}
return h;
}
void main()
{
bitre t;
int k;
bptrlink ptr;
initial_bitre();
create_ex_bitre(t);
comput_bitre_card(t);
window(1,1,80,3);
create_bptr(ptr, "T");
disp_bitre("Preorder",t);
k=hight(t,ptr);
getch();
window(1,1,15,3);
printf("high=%d\n",k);
getch();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -