线性表的顺序表示和实现:Union

void Union(SqList *La,SqList Lb){
    int La_len = ListLength(*La);
    int Lb_len = ListLength(Lb);
    ElemType e;
    for(int i=1;i<=Lb_len;i++){
        GetElem(Lb,i,&e);
        if(!LocateElem(*La,e,my_compare))
            ListInsert(La,++La_len,e);
    }
}
发布了14 篇原创文章 · 获赞 1 · 访问量 2万+

猜你喜欢

转载自blog.csdn.net/lzdelphi/article/details/104320745