#include<iostream>
using namespace std;
//树非二叉树的储存结构
//1双亲表示法;//包含数据域,双亲域(数组的下标);
#define maxsize 10
typedef struct ptnode
{
int data;
int parent;
}ptnode;
typedef struct ptree
{
ptnode nodes[maxsize];
int r, n;//r根的位置,n结点数
};(找双亲容易找孩子难)
//孩子链表表示法;//每个节点的孩子看成线性表,用单链表存放;
typedef struct ctnode
{
int child;//下标位置;
ctnode* next;//指向下一个孩子
}*childptr;(找孩子容易找双亲难)
typedef struct ctbox
{
int data;
childptr firstchild;
}ctbox;
typedef struct ctree
{
ctbox nodes[maxsize];
int n, r;//根结点位置和结点数
};
//孩子兄弟表示法;包含第一个孩子和兄弟结点;
typedef struct csnode
{
int data;
csnode* firstchild,*nextbrother;//firstchild指向第一个孩子,nextbrother指向同一层的兄弟
}csnode ,*cstree;
int main()
{
return 0;
}