#include
Typedef struct node
{
int num;
Struct node * next;
} AGD.
AGD * createlist ()
{
AGD * head, * p;
Int I, n;
Printf (" node number n=");
The scanf (" % d ", & amp; N);
The head=p=(AGD *) malloc (sizeof (AGD));
The head - & gt; Num=0;
Printf (" input % d integer: \ n ", n);
for(i=0; i
P - & gt; Next=(AGD *) malloc (sizeof (AGD));
The scanf (" % d ", & amp; P - & gt; Next - & gt; Num);
P=p - & gt; Next;
}
P - & gt; Next=head;
return head;
}
AGD * mutualagg (AGD * A, AGD * B)//intersection
{
AGD * C * pa, pb, PC, * qc;
C==PC (AGD *) malloc (sizeof (AGD));
PC - & gt; Num=0;
Pa=A - & gt; Next;
Pb=B;
While (pa!
=A){
Pb=B - & gt; Next;
While (pb!=B)
{
If (pb - & gt; Num==pa - & gt; Num)
{
Qc=(AGD *) malloc (sizeof (AGD));
Qc - & gt; Num=pb - & gt; Num.
PC - & gt; Next=qc;
PC=qc;
}
Pb=pb - & gt; Next;
}
Pa=pa - & gt; Next;
}
PC - & gt; Next=C;
Return the C;
}
AGD * bingagg (AGD * A, AGD * B)//and set
{
AGD * C * pa, pb, PC, * qc;
C==PC (AGD *) malloc (sizeof (AGD));
PC - & gt; Num=0;
Pa=A - & gt; Next;
Pb=B;
While (pa!
=A){
Pb=B - & gt; Next;
While (pb!=B)
{
If (pb - & gt; Num==pa - & gt; Num& & Pb - & gt; Num> Pa - & gt; Num)
{
Qc=(AGD *) malloc (sizeof (AGD));
Qc - & gt; Num=pb - & gt; Num.
PC - & gt; Next=qc;
PC=qc;
}
The else
{
Qc=(AGD *) malloc (sizeof (AGD));
Qc - & gt; Num=pa - & gt; Num.
PC - & gt; Next=qc;
PC=qc;
}
Pb=pb - & gt; Next;
}
Pa=pa - & gt; Next;
}
PC - & gt; Next=C;
Return the C;
}
AGD * chaagg (AGD * A, AGD * B)//difference set (belong to the array but does not belong to the array B)
{
AGD * C * pa, pb, PC, * qc;
C==PC (AGD *) malloc (sizeof (AGD));
PC - & gt; Num=0;
Pa=A - & gt; Next;
Pb=B;
While (pa!
=A){
Pb=B - & gt; Next;
While (pb!=B)
{
If (pb - & gt; Num!=pa - & gt; Num)
{
Qc=(AGD *) malloc (sizeof (AGD));
Qc - & gt; Num=pa - & gt; Num.
PC - & gt; Next=qc;
PC=qc;
}
Pb=pb - & gt; Next;
}
Pa=pa - & gt; Next;
}
PC - & gt; Next=C;
Return the C;
/*
AGD * C * pa, pb, PC, * qc;
C==PC (AGD *) malloc (sizeof (AGD));
PC - & gt; Num=0;
Pa=A - & gt; Next;
Pb=B;
While (pa!
=A){
Pb=B - & gt; Next;
While (pb!=B)
{
If (pb - & gt; Num==pa - & gt; Num)
{
continue;
}
The else
{
Qc=(AGD *) malloc (sizeof (AGD));
Qc - & gt; Num=pa - & gt; Num.
PC - & gt; Next=qc;
PC=qc;
}
Pb=pb - & gt; Next;
}
Pa=pa - & gt; Next;
}
PC - & gt; Next=C;
Return the C;
*/
}
Void printlist (AGD * head)
{
AGD * p=head - & gt; Next;
Short counter=0;
while(p!=head)
{
If (counter& & Counter % 10==0)
printf("\n");
Printf (" % 5 d ", p - & gt; Num);
Counter++;
P=p - & gt; Next;
}
If (counter % 10)
printf("\n");
}
Void freeheap (AGD * head)
{
AGD * p, * q;
P=the head;
Q=p - & gt; Next;
While (q!=head)
{
P=q;
Q=p - & gt; Next;
free(p);
}
Free (the head);
}
Int main ()
{
AGD * A, *, B * C * D * E;
Printf (" create the collection A: \ n ");
A=createlist ();
Printf (" create the collection B: \ n ");
B=createlist ();
Printf (" A collection of elements are: \ n ");
Printlist (A);
Printf (" set B elements are: \ n ");
Printlist (B);
C=mutualagg (A, B);
Printf (" intersection=C: \ n ");
Printlist (C);
Printf (" and set=c: \ n ");
C=bingagg (A, B);
Printlist (C);
printf("\n");
Printf (" difference set=c: \ n ");
C=chaagg (A, B);
Printlist (C);
Freeheap (A);
Freeheap (B);
Freeheap (C);
Printf (" \ n \ n ");
return 0;
}
How does this not achieve them