我们可以这样来描述广义表的结点类型: struct node{ int tag; union{ struct node* dlink; char data; } struct node *next; } typedef struct node NODE; 1、实现复制算法: NODE *copy(NODE *head) { NODE *p; if(head==NULL) return(NULL); p=(NODE *)malloc(sizeof(NODE)); p->tag=head->tag; if(head->tag==1) p->dd.link=copy(head->dd.dlink); else p->dd.data=head->dd.data; p->next=copy(head->next); return(p); } 2、删除值为x的原子结点的算法: NODE *delete(NODE *head,char x) { NODE *p; if(head==NULL) return(NULL); p=delete(head->next,x); if(head->tag==0) { free(head); return(p); } head->next=p; if(head->tag==1) head->dd.dlink=delete(head->dd.link,x); return(head); }