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
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