Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

•Write a public class ArrayTest with a main method which first parses a command-

ID: 3670842 • Letter: #

Question

•Write a public class ArrayTest with a main method which first parses a command-line argument into an int variable n, which represents the size of an array to be generated and sorted, and then declares an array of size n;

•Give ArrayTest a static method fillArray(int [] array) to fill the argument array with random integers between 1 and 1000000;

•In main, call fillArray() to fill the array with random int elements and then call the java.util.Arrays sort method to sort that array

•Measure the time it takes to sort the array using the java.lang System.nanoTime() method to compute the start and end times in nanoseconds (10^-9 seconds) right before and after the sort call, via

•long startTime = System.nanoTime(); // right before sort call

•long endTime = System.nanoTime();   // right after sort call

•Then elapsed time is endTime – startTime;

•Run this for array sizes n = 10^2, 10^4, 10^6, and 10^8 and graph elapsedTime vs. array size

Explanation / Answer

Hi below i have written a important Queue operations  that parses a command-line argument into an int variable n, which represents the size of an array,

}