📄 emp6_14.cpp
字号:
//emp6_14
#include "trees.h"
const int n=18;
typedef int arr[n];
arr brother={14,7,3,6,5,0,0,11,0,10,0,0,0,0,17,16,0,0};
char data[n];
void create_trees(tree &t,int i1,int i2)
{
if (i1>i2) t=NULL;
else{
t=(tree)malloc(sizeof(struct grtnode));
t->data=data[i1];
if (brother[i1]==0){
create_trees(t->firstson, i1+1,i2);
t->nextbrother=NULL;
}else{
create_trees(t->firstson, i1+1,brother[i1]-1);
create_trees(t->nextbrother,brother[i1],i2);
}
}
}
void main()
{
tree t;
int i;
for(i=0;i<n;i++) data[i]=i+65;
create_trees(t,0,n-1);
display_tree("aa",t);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -