Question: Using this provided interface: public interface MultiSet { void add( AnyType x ); boolean contains( AnyType x ); int count( AnyType x ); boolean removeOne(
Using this provided interface:
public interface MultiSet
Make a TreeMultiSet class that implements MultiSet, A TreeMultiSet stores items in sorted order. The data representation can be a TreeMap, in which the key is an item that is in the multiset, and the value represents the number of times the item is stored. Implement the TreeMultiSet
1. TreeMultiSet has an attribute of type TreeMap
2. Use methods that TreeMap provides such as get, put, remove.
3. Override toString in the TreeMultiSet class, so you can specify how the TreeMap prints the attributes.
Also create a runner class with main method to test the code using String and Integers.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
