Question: I need help writing a method that prints in the format listed below. I have included the benchmarks that it uses. Implement the method public
I need help writing a method that prints in the format listed below. I have included the benchmarks that it uses.


Implement the method public void runBenchmarks(int size). See the interface for more information. Hint: should call the two benchmark methods above. The output should look like below. [4 points] Bin Half RanInt Insertion #### #### #### Shellsort #### #### #### public double benchmarkInsertionSort(Integer[] small, Integer[] large) { double a; double b; Stopwatch watchSmall = new Stopwatch(); insertionSort(small); a = watchSmall.elapsedTime(); Stopwatch watchlarge = new Stopwatch(); insertionSort(large); b = watchLarge.elapsedTime(); return computeDoublingFormula(a,b); } public double benchmarkShellsort(Integer [] small, Integer [] large) { double a; double b; Stopwatch watchSmall = new Stopwatch(); shellsort(small); a = watchSmall.elapsedTime(); Stopwatch watchLarge = new Stopwatch(); shellshort(large); b = watchLarge.elapsedTime(); return computeDoublingFormula(a,b); } public void runBenchmarks(int size) { } Implement the method public void runBenchmarks(int size). See the interface for more information. Hint: should call the two benchmark methods above. The output should look like below. [4 points] Bin Half RanInt Insertion #### #### #### Shellsort #### #### #### public double benchmarkInsertionSort(Integer[] small, Integer[] large) { double a; double b; Stopwatch watchSmall = new Stopwatch(); insertionSort(small); a = watchSmall.elapsedTime(); Stopwatch watchlarge = new Stopwatch(); insertionSort(large); b = watchLarge.elapsedTime(); return computeDoublingFormula(a,b); } public double benchmarkShellsort(Integer [] small, Integer [] large) { double a; double b; Stopwatch watchSmall = new Stopwatch(); shellsort(small); a = watchSmall.elapsedTime(); Stopwatch watchLarge = new Stopwatch(); shellshort(large); b = watchLarge.elapsedTime(); return computeDoublingFormula(a,b); } public void runBenchmarks(int size) { }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
