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 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
Step: 1
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...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started