㈠ C語言編程題,利用兩個線性表LA和LB分別表示兩個集合A和B,現要求一個集合A=A並B
利用兩個線性表LA和LB分別表示兩個集合A和B,現要求一個新的集合A=A∪B。
void union(List &La,List Lb) {
La-len=listlength(La);
Lb-len=listlength(Lb);
for(I=1;I<=lb-len;I++) {
getelem(lb,I,e);
if(!locateelem(la,e,equal))listinsert(la,++la-en,e)
}
}