/*********广义表的头尾链表存储表示**************/
#include<cstdio>
#include<algorithm>
using namespace std;
typedef int AtomType; ///定义AtomType为int类型
typedef enum { ATOM, LIST } ElemTag; ///ATOM==0; 原子,LIST==1;子表
typedef struct FLNode {
ElemTag tag; ///公共部分,用于区分原子节点和表结点
union { ///原子节点和表结点的联合部分
AtomType atom; ///atom是原子节点的值域,AtopType由用户定义
struct { struct GLNode *hp, *tp; }ptr; ///ptr是表节点的指针域,ptr.hp好人ptr.tp分别指向表头和表尾
};
} *GList; ///广义表类型
int main()
{
return 0;
}
(数据结构第五章)广义表的头尾链表存储表示
最新推荐文章于 2024-06-09 22:16:32 发布