#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<stdlib.h>
#include<cstdio>
#include<string.h>
#include<math.h>
#include<fstream>
#include<map>
using namespace std;
//孩子表示法
#define MAX_TREE_SIZE 100
typedef char TElemType;
typedef struct CTNode
{
int child;
struct CTNode* next;
}*ChildPtr;
typedef struct
{
TElemType data;
ChildPtr firstchild;
}CTBox;
typedef struct{
CTBox nodes[MAX_TREE_SIZE];
int r,n;
}CTree;
//孩子表示法
int main()
{
CTree mCTree;
mCTree.r=0;
mCTree.n=10;
for(int i=0;i<mCTree.n;i++)
{
mCTree.nodes[i].data='A'+i;
}
CTNode ctNode[10];
for(int i=1;i<=9;i++)
{
ctNode[i].child=i;
}
ctNode[1].next=&ctNode[2];
ctNode[4].next=&ctNode[5];
ctNode[6].n
孩子表示法(c++)
最新推荐文章于 2022-12-22 20:21:52 发布