Question: Java task 1-6 please Task 1: Add three methods: union, intersection, and difference to the interface BagInterface for the ADT bag. The detailed description of

Java task 1-6 please
Task 1: Add three methods: union, intersection, and difference to the interface BagInterface for the ADT bag. The detailed description of the three methods and how to call the three methods could be found on pages 2 and 3 of this assignment. Note: the three methods to implement are for Bags, not for Sets. Task 2: Implement the three methods, union, intersection, and difference, for the class ResizeableArrayBag. Note: the class ResizeableArrayBag presents an implementation of the ADT bag using a resizable array. Generics are needed! Task 3: Implement the three methods, union, intersection, and difference, for the class LinkedBag. Note: the class LinkedBag presents an implementation of the ADT bag using a linked chain. Generics are needed! Task 4: Write a client program, "ArrayBagTest.java", which contains a main method to test the three methods (union, intersection, and difference) you implemented for the class ResizeableArrayBag. Note that when you examine the method "difference", please test both bag2.difference(bag 1) and bag1.difference(bag2), given two bags bag2 and bag 1 . Task 5: Write a client program, "LinkedBagTest.java", which contains a main method to test the three methods (union, intersection, and difference) you implemented for the class LinkedBag. Note that when you examine the method "difference", please test both bag2.difference(bag1) and bag1.difference(bag2), given two bags bag2 and bag 1 . Task 6: Use Big O notations to indicate the time complexity of each method you implemented (the three methods implemented in Task 2 and the three methods implemented in Task 3) in the best case and the worst case, respectively. Please also provide explanation to each of Big O notations
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
