⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 emp6_14.cpp

📁 该包是数据结构的实验软件,来源于合肥工业大学人工智能与数据挖掘实验室,用来实现数据结构.
💻 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 + -