文章分类 - 数据结构
数据结构的学习笔记和心得
摘要:Questions:存在两个线性表La和Lb,求A=A∪B. void union(List &La,List Lb){ //将所有在线性表Lb中但不在La中的数据元素插入到La中。 La_len = ListLength(La); Lb_len = ListLength(Lb); for(i=1;i<Lb_len;i++){ GetElem(Lb,i,e);//取Lb中的第i个数据元素赋给e。 if(!LocateElem(La,e,equal)) ListInsert(La,++La_len,e);//La中不存在和e相同的数据元素,则插入。 }}//un...
阅读全文

浙公网安备 33010602011771号