Prepare a new container class called ser which is similar


Question: A bag can contain more than one copy of an item. For example, the chapter explains a bag that contains the number 4 and two copies of the number 8. This bag behavior is different from a set, which can contain only a single copy of any given item.

Prepare a new container class called ser, which is similar to a bag, except that a set can contain only one copy of any given item, you'll need to change the interface a bit. For example, instead of the bags count function, you'll want a constant member function such as this:

bool set:: contains

(const value_type& target) const;

//Post condition: The return value is true if target is in the set; otherwise the return value is false.

Make an explicit statement of the invariant of the set class. Do a time analysis for each operation. At this point, an efficient implementation is not needed. For example, just adding a new item to a set will take linear time because you'll need to check that the new item isn't already present,

Later we'll explore more proficient implementations (including the implementation of set in the C++ Standard Library.

You can also want to add additional operations to your set class, such as an operator for subtraction.

Use C++ and please create three file including header file

Request for Solution File

Ask an Expert for Answer!!
C/C++ Programming: Prepare a new container class called ser which is similar
Reference No:- TGS0951384

Expected delivery within 24 Hours