Question: Consider a type IntBag, with operations to insert and remove elements, as well as all the observers of IntSet. Bags are like sets except that
Consider a type IntBag, with operations to insert and remove elements, as well as all the observers of IntSet. Bags are like sets except that the elements can occur multiple times in a bag. Is IntBag a legitimate type of IntSet?Explain by arguing that either the substitution principle is violated (for non-subtype) or that it holds(for subtype)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
