typedef struct node
{int tag; //tag=
struct node *link; //指向後繼結點的指針
union {struct node *slink; //指向子表的指針
char data; //原子
}element;
}Glist;
Glist *creat () //建立廣義表的存儲結構
{char ch; Glist *gh;
scanf(
if(ch==
else {gh=(Glist*)malloc(sizeof(Glist));
if(ch==
gh
else {gh
}
scanf(
if(gh!=null) if(ch==
else gh
return(gh);
}
}算法結束
[
From:http://tw.wingwit.com/Article/program/sjjg/201311/23024.html