Question: write this in Java for eclipse 1. (5 points) Add each of the following methods to the OurList interface. (a) numinFirstK, which takes a value
1. (5 points) Add each of the following methods to the OurList interface. (a) numinFirstK, which takes a value and an integer k. The method returns the number of times that the value appears in the first k values of the list (NOT up to index k ). If k is negative, the method should throw an Index0ut0fBoundsException. If it is greater than the number of values in the list, the method returns the total number of occurrences of the value in the list. (b) removeLast0fEach, which removes the last occurrence of each of the values it contains. Thus, calling it on the list ("An,"B,B+"A,"An) would change the list to ("A","B", " A"). If a value only appears in the list once, it is removed from the list entirely. 2. (20 points) Write test cases for the methods listed in the previous problem in OurListTest. 3. (20 points) Implement the methods listed in problem 1 as part of the array-based list in DurArrayList. 4. (20 points) Implement the methods listed in problem 1 as part of the linked list in DurLinkedList
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
