Question: I need help with this java assingment Thanks. RunTime Class - You will write the RunTime.java class which will implement the Runtime Interface. Array Based
I need help with this java assingment Thanks.
RunTime Class - You will write the RunTime.java class which will implement the Runtime Interface.
Array Based List Class- You will write the ArrayBasedList.java class which will implement the List Interface. Please note that you do not inherit from the RunTime class.
Driver Class- You will write the Driver.java class which will implement the Driver Interface. Please note that you do not inherit from the RunTime class. However, you do have to use the RunTime class to measure run times.
Runtime Interface Methods


ListInterface Methods


Driver Interface Methods


Test Cases
All the elements being added and removed from the list must be instances of the Integer class.
You will test the following scenario for the Array Based List implementation:
Driver.TestType.AddSortedOdd: Starting with an empty list, use the addSorted(I obj) method to add java.lang.Integer objects representing the odd numbers (1 n 9,999) to the list.
Driver.TestType.AddSortedEven: Starting with a list containing the odd numbers less than 10,000, use the addSorted(I obj) method to add java.lang.Integer objects representing the even numbers (2 n 10,000) to the list.
Driver.TestType.AddAll: Starting with an empty list, use the add(I obj) method to add 10,000 java.lang.Integer objects to the list.
Driver.TestType.AddAllAtIndexZero: Starting with an empty list, use the add(Object obj, int index) method to add 10,000 java.lang.Integer objects to the list, all at index = 0.
Driver.TestType.RemoveAllEven: Starting with a complete list containing 10,000 java.lang.Integer objects representing all the numbers (1 n 10,000); remove all the even numbers by repeatedly calling the remove(int index) method. Remove the even numbers starting with 2, then 4, then 6, ....
Driver.TestType.RemoveAllOdd: Starting with a complete list containing 10,000 java.lang.Integer objects representing all the numbers (1 n 10,000); remove all the odd numbers by repeatedly calling the remove(int index) method. Remove the odd numbers starting with 9,999, then 9,997, then 9,995, ....
Output From Driver Main Method
Please note that, in addition to implementing the DriverInterface, you are also required to write your own public static main(String[] args) method in Driver.java.
Your main() method will have to call the runTestCase() method for each of test cases listed above a total of ten times for each test case:
For each call to the runTestCase() method your main() method will a table with the following output for the Array Based List implementation:
Running test = Test Case Name Run 1 Run 2 Run 3 Run 4 Run 5 Run 6 Run 7 Run 8 Run 9 Run 10 Average Memory Usage Seconds Seconds Seconds Seconds Seconds Seconds Seconds Seconds Seconds Seconds Seconds Mega Bytes ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------------ ArrayBasedList
Please note that the run times and the average are in Seconds and the memory usage is in Mega Bytes. You will need to make the necessary conversions.
Interface Runtimelnterface public interface Runtimelnterface This interface will be used to organize and manage runtimes that are measured for specific operations. The user will utilze system.nanoTime to measure the runtime of an operation. Before the operation is started, you can obtain the start time: startTime System nanoTime After the operation is completed, you can obtain the end time endTime System nanoTime Run Time is then: run Time endTime startTime. Author: Sameh A. Fakhouri Method Summary All Methods Instance Methods Abstract Methods Method and Description Modifier and Type void addRuntime (long runTime) Interface Runtimelnterface public interface Runtimelnterface This interface will be used to organize and manage runtimes that are measured for specific operations. The user will utilze system.nanoTime to measure the runtime of an operation. Before the operation is started, you can obtain the start time: startTime System nanoTime After the operation is completed, you can obtain the end time endTime System nanoTime Run Time is then: run Time endTime startTime. Author: Sameh A. Fakhouri Method Summary All Methods Instance Methods Abstract Methods Method and Description Modifier and Type void addRuntime (long runTime)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
