In the mathematical theory of sets, a set is defined as acollection of distinct items of the same type. In someprogramming languages, sets are built-in data type; unfortunately,this is not the case in C++. However, we can simulate aset using a one-dimensional array.
Some operations can be performed on sets. We willconsider only three of them: union, intersection, anddifference. These are binary operations requiring twosets as operands. The union of two sets, A and B, is aset that contains elements that are in A and B. The intersection oftwo sets, A and B, is a set that contains elements common to both Aand B. Finally, the difference
OR
OR