Question
java Create ADT: arrayRemove which has add(E a), remove(int i), remove(E r) should act like List ADT. Create an implementation called arrayIncrement. Implements arrayRemove such
java
Create ADT: arrayRemove which has add(E a), remove(int i), remove(E r) should act like List ADT.
Create an implementation called arrayIncrement. Implements arrayRemove such that if an user added element and there is no space, create new array with only one space to add the element.
When the user removes element, all remaining element shifts to avoid having empty space. [ 2 3 4 5 6] with first position removed will have [ 4 5 6] after the shift.
Create another implementation called doubleArray, same as arrayIncrement but array is doubled the size instead of only one spot. If array is 10 elements, the double array should be 20 and not 11.
Create tester file, with a method to add to an array with 2 arguments, array remove and the number of n elements. N = 3 ends up being 1 2 3 in the created array.
Create another method that measures the time that returns the time it took to add the number of elements to object.
This method also has 2 arguments, arrayRemove and n elements. Create another run method with 2 arguments arrayRemove and filename.
This will measure time to add to the array n, from 30,000 to 430000 by incrementing the steps by 30000. (30,000, 60,000 to 430000) repeat the steps 5 times and store the result to the file to the argument filename.
output example:
n, n1, n2,....
30000, [time it took], [time it took], [time it took]...
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