Answered step by step
Verified Expert Solution
Link Copied!

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
image text in transcribed
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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts International Edition

Authors: David M. Kroenke

6th Edition International Edition

0133098222, 978-0133098228

More Books

Students also viewed these Databases questions

Question

1. Discuss the four components of language.

Answered: 1 week ago

Question

a. How many different groups were represented?

Answered: 1 week ago