Question: Write a complete bag class implementation using linked list implementation. The bag interface should be the same as BagInterface . The linked bag class name
Write a complete bag class implementation using linked list implementation. The bag interface should be the same as BagInterface. The linked bag class name must be LinkedBag (linkedbag.java). There also must be another file (main.java) to test the methods that need to be defined along with the baginterface (baginterface.java). Here's what must be done.
1. Get the number of items currently in the bag
2. See whether the bag is full
3. See whether the bag is empty
4. Add a given object to the bag
5. Remove an unspecified (not random) object from the bag
6. Remove an occurrence of a particular object from the bag, if possible
7. Remove all objects from the bag
8. Count the number of times a certain object occurs in the bag
9. Test whether the bag contains a particular object
10. Look at all objects that are in the bag
These are the methods in the interface that must be defined.
public interface BagInterface
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
