10QB求助~~要有源代码
设集合A={al , a2, a3… ,am },集合B={bl , b2,… ,bn}求A-B= {x|x∈A∧x¢B}
void difference(Linklist LA,Linklist LB) { Linklist pre,p,q,r; pre = LA; p = LA->next; while(p != NULL) { q = LB->next; while(q != NULL && q->data != p->data) q = q->next; if(q != NULL) { r = p; pre->next = p->next; p = p->next; free(r); } else { pre = p; p = p->next; } } }