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)

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

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!