c语言链表集合求并集用字母表示,c语言给定两个集合A和B,求集合A和集合B的并集。给定两个集合A和B,求集合A和集合B的并集。例如:A={1,2,3},B={2,3,4},则A∪B={1,2,3,4}...
struct Link *Union(struct Link *head1, struct Link *head2){struct Link *p1 = head1->next, *p2 = head2->next;struct Link *head, *p, *q;head = (struct Link *)malloc(sizeof(struct Link));head->n...