Question: c++ union and intersection Define a set a with certain values, like 1, 2, 3, 4 and set b with certain values like 3, 4,

c++ union and intersection

Define a set a with certain values, like 1, 2, 3, 4 and set b with certain values like 3, 4, 5, 6

Have main create three objects: setA with set a, setB with set b, and setC with set a.

Print the setA, setB, setC

Do an union of setA with setB (setA will be changed) then print setA

Do an intersection of setC (setC will be changed) with setB then print setC

unionOps, that takes a Sets object and does a union with the current set

intersection, that takes a Sets object and does an intersection with the current set

printSet, will print the Sets object contents

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!