文件名称:collectioncaculator
介绍说明--下载内容均来自于网络,请自行研究使用
运用顺序表的基本运算。(插入、删除)
1)集合的数据类型为一个结构体,其中包括一个数组用来存放集合元素,一个整型数据来统计集合元素的个数。生成两个集合A和B。
2)将集合中的元素按照从小到大排序。具体方法为:从第二个元素起(i),依次扫描每个元素前面的所有元素(j),若i<j,则将j插在i的前面,结束对i的排序,照这个方法,再依次对i后的元素进行排序。
3)求两集合的并:生成一个新集合C,将集合A的元素复制过来,对集合B的元素依次进行扫描,若没有该元素,则插入,若已存在,则扫描下一个。求两集合的交:生成一个新的集合D,对于集合A中的每一个元素i,都对集合B中的所有元素都进行一次扫描,若B中有元素i,则将i插入到D中,若没有,则看集合A中的下一个元素。求两集合的差:生成两个新集合E和F,分别为两个集合之差集。E的元素为从集合A中除去两集合之交集D的元素,F的元素为从集合B中除去D的元素。-A collection of computing devices to use the order form the basic operations. (Insert, delete)
1) the type of data collection for a structure, including an array used to store a collection of elements, an integer data to statistics the number of elements in the collection. Generate two sets A and B.
2) In accordance with the elements of the collection from small to large order. Specific methods as follows: starting from the second element (i), followed by scanning all the elements in front of each element (j), if i <j, will be inserted in the i in front of j, to conclude i sort, according to this method , and then turn right after i sorted elements.
3) Find the two sets and: to generate a new set of C, will be copied elements of the collection A of elements of set B, in turn scan, if not the element, then insert, where they already exist, then scan the next one. Seeking two sets Attn: generate a new set of D, for the set A, each element of i, are all set B, all the elements to
1)集合的数据类型为一个结构体,其中包括一个数组用来存放集合元素,一个整型数据来统计集合元素的个数。生成两个集合A和B。
2)将集合中的元素按照从小到大排序。具体方法为:从第二个元素起(i),依次扫描每个元素前面的所有元素(j),若i<j,则将j插在i的前面,结束对i的排序,照这个方法,再依次对i后的元素进行排序。
3)求两集合的并:生成一个新集合C,将集合A的元素复制过来,对集合B的元素依次进行扫描,若没有该元素,则插入,若已存在,则扫描下一个。求两集合的交:生成一个新的集合D,对于集合A中的每一个元素i,都对集合B中的所有元素都进行一次扫描,若B中有元素i,则将i插入到D中,若没有,则看集合A中的下一个元素。求两集合的差:生成两个新集合E和F,分别为两个集合之差集。E的元素为从集合A中除去两集合之交集D的元素,F的元素为从集合B中除去D的元素。-A collection of computing devices to use the order form the basic operations. (Insert, delete)
1) the type of data collection for a structure, including an array used to store a collection of elements, an integer data to statistics the number of elements in the collection. Generate two sets A and B.
2) In accordance with the elements of the collection from small to large order. Specific methods as follows: starting from the second element (i), followed by scanning all the elements in front of each element (j), if i <j, will be inserted in the i in front of j, to conclude i sort, according to this method , and then turn right after i sorted elements.
3) Find the two sets and: to generate a new set of C, will be copied elements of the collection A of elements of set B, in turn scan, if not the element, then insert, where they already exist, then scan the next one. Seeking two sets Attn: generate a new set of D, for the set A, each element of i, are all set B, all the elements to
(系统自动生成,下载前可以参看下载内容)
下载文件列表
集合运算器.cpp