Question: You are to write a program in C++ that uses a Set class to store elements in sorted order. You should be able to calculate

You are to write a program in C++ that uses a Set class to store elements in sorted order. You should be able to calculate the intersection and union between two sets. The set will be implemented as a resizable array. You should first ask the user to input two lists of numbers in the form (1,2,3). You should insert the elements entered by the user into two different sets, and then print each set in sorted order. You should then ask the user whether they want the intersection or union between the two sets, and then print the result. Recall that sets are lists of elements with no duplicates. If the user enters (1,2,3,1,2,3) you should just store (1,2,3). Also, the union of two sets A and B is a set of all elements that appear in either A or B. The intersection of A and B is a set of all elements that appear in both A and B

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!