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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started