Question: A J Unit tester is supplied, and requires modifications to work (Found below) Everything has been provided Implement an ADT (specifically a


A J Unit tester is supplied, and requires modifications to work (Found below)

 

Everything has been provided

 

● Implement an ADT (specifically a resizable array and Linked List based implementation of the Bag ADT) 

● Test a class 

 

General requirements: 

●  produce exactly two source code files: ArrayBag.java and LinkedBag.java 

● include the Bag interface as specified in BagInterface.java. Do not modify this file.  the resizable array bag and Linked List bag must implement this interface.  

● Use default package (no package statements in files). 

 

 

Need to provide ArrayBag & LinkedBag (These both need to implement Bag Interface)


Specific requirements: For this project, you will implement Bag ADT for genericobjects in two ways: using a resizable array, and using linked nodes.Bag is similar to Set except that duplicates are allowed. Highlights ofthe Bag ADT: Order is unimportant (and unpredictable) Duplicates are allowed We

Specific requirements: For this project, you will implement Bag ADT for generic objects in two ways: using a resizable array, and using linked nodes. Bag is similar to Set except that duplicates are allowed. Highlights of the Bag ADT: Order is unimportant (and unpredictable) Duplicates are allowed We want to be able to: o Add items to the bag o Remove items from the bag (2 ways: remove a specific item, and remove an arbitrary item) o Find the number of items stored in the bag (i.e., size) o Check if an item is in the bag o Count the number of times an item is found in the bag o Remove duplicates from the bag o Check if the bag contains all the elements that are in another bag (ignoring duplicates) o Check if this bag contains exactly the same elements as those in another bag (i.e., anagram)

Step by Step Solution

3.52 Rating (152 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To implement the Bag ADT in Java using a resizable array you can follow these steps Define an interface BagInterface with the specified methods Implem... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!