Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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 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
Step: 1
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