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

Does anyone know how to do this? This is an assignment that I am working on for

ID: 3549490 • Letter: D

Question

Does anyone know how to do this? This is an assignment that I am working on for my Algorithm course and it has to done using NetBeans IDE 7.4. Here's how it works:

Write a program to evaluate the execution time for several types of program structures. Use the Stopwatch class described below:

public class Stopwatch:

Stopwatch () create a stopwatch
double elapsedTIme() return elapsed time since creation

typical client:

public static void main(String[] args)

{

     int N = Integer.parseInt(args[0]);

     int[] a = new int[N];

     for (int i = 0; i < N; i++)

         a[i] = StdRandom.uniform(-1000000, 1000000);

     Stopwatch timer = new Stopwatch();

     int cnt = ThreeSum.count(a);

     double time = timer.elapsedTime();

     StdOut.printIn(cnt +

Explanation / Answer

/** * Replace this line with class description. *

* User: George Sun * Date: 9/15/13 * Time: 9:45 PM */   public class SortCompare {          public static void main(String[] args) {           String alg1 = args[0];           String alg2 = args[1];           int N = Integer.parseInt(args[2]);           int T = Integer.parseInt(args[3]);              double t1 = timeRandomInput(alg1, N, T);           double t2 = timeRandomInput(alg2, N, T);           StdOut.printf("For %d random Doubles       %s is: ", N, alg1);           StdOut.printf(" %1f times faster than %s ", t2 / t1, alg2);       }          public static double timeRandomInput(String alg, int N, int T) {           double total = 0.0;           Double[] a = new Double[N];           for (int t = 0; t

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote