集合的交并差.docVIP

  • 7
  • 0
  • 约 6页
  • 2016-12-25 发布于河南
  • 举报
#includeiostream using namespace std; typedef struct Node{ char data; Node *next; }Node,*LinkList; #define SIZE sizeof(Node) #define FALSE 0 #define TRUE 1 //初始化集合 void InitLinkList(LinkList Head) { char ch;Node *p=Head; Head-next=NULL; Head-data=\0; cinch; while(ch!=#) { Node *newNode=(Node*)malloc(SIZE); newNode-data=ch; p-next=newNode; p=p-next; cinch; } p-next=NULL; } //检查p1或p2所指向数据结点该不该加入到Head为起始的集合中 int Check(char ch,LinkList Head) { Node *temp=Head-next; int flag=TRUE; while(temp!=NULL) { if(temp-data==ch){//不需要将数据插入 flag=FALSE; return flag; } temp=t

文档评论(0)

1亿VIP精品文档

相关文档