Question: Exercise 1 (CL01, 6): Write a Java Code (or a pseudo-code) which perform the following task. Question 1: Write an implementation of a method called

Exercise 1 (CL01, 6): Write a Java Code (or a pseudo-code) which perform the following task. Question 1: Write an implementation of a method called removeAll, which takes a bag of type String as an input and an Item string which you want to completely delete all of its occurrences from the bag. Note that you are not aware of the underlying bag implementation, which can be an array or linked list. Hint: use the standard public Bag interface methods to implement the method. Question 2: Write an implementation of a method called combin2Bags, which takes two bags of Strings A and B and add all the B bags element into the bag A. Note that you are not aware of the underlying bag implementation which can be an array or linked list. Hint: use the standard public Bag interface methods to implement the method. Question 3: Write an implementation of a method called findMax, which takes a bag of type Integer as an input and returns the maximum number in the bag. Note that you are not aware of the underlying bag implementation, which can be an array or linked list. Hint: use the standard public Bag interface methods to implement the method
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
