-
Create a class
CreateArray
that contains the following methods:-
The
Random
class can be instantiated to create an object that will generate (pseudo-)random values. Create a methodrandomArray
:public static int[] randomArray(int n) { … }
This method should return an array filled with
n
randomly generated integers. -
Create a method
sortedArray
:public static int[] sortedArray(int n) { … }
This method should return an array filled with
n
randomly generated integers that are in increasing order. Hint: call your function from (a) and then sort the result.
-
The
-
Create a text file
runningtime.txt
that contains answers to the following:-
What is the running time of the
randomArray
method you created above? Briefly explain why. -
What is the running time of the
sortedArray
method you created above? Briefly explain why.
-
What is the running time of the
-
Create a text file named
time.txt
. In it, indicate how long it took you to complete this lab exercise.
When you're done, create a ZIP file containing all of the files you created for this lab and submit it with the submission server.