Question: the link: https://www.calculator.net/log-calculator.html StringExperiment.java: public class StringExperiment { /** Uses repeated concatenation to compose a String with n copies of character c. */ public static

 the link: https://www.calculator.net/log-calculator.html StringExperiment.java: public class StringExperiment { /** Uses repeated

the link: https://www.calculator.net/log-calculator.html

StringExperiment.java:

public class StringExperiment { /** Uses repeated concatenation to compose a String with n copies of character c. */ public static String repeat1(char c, int n) { String answer = ""; for (int j=0; j 0) trials = Integer.parseInt(args[0]); if (args.length > 1) n = Integer.parseInt(args[1]); } catch (NumberFormatException e) { } int start = n; // remember the original starting value // let's run version 2 (the quicker one) first System.out.println("Testing repeat2..."); for (int t=0; t Perform an experimental analysis of the two algorithms prefixAveragel and prefixAverage2 given in file PrefixAverage.java. Visualize their running times as a function of the input size with a log-log chart (A log-log chart is a two-dimensional graph where the x-coordinates and ycoordinates are logarithmic values [base of log should be same in both axes]). A log calculator can be found in https://www.calculator.net/log-calculator.htm1. Do the log-log chart using Microsoft excel and submit the screenshot of the graph. (Hint: Choose representative values of the input size n, similar to StringExperiment.java in Lesson4Examples.zip posted in the eCentennial module "Lesson Examples (from textbook)". You might like to use System class's method nanoTime( instead of the method currentTimeMillisO) ). (5 marks) Perform an experimental analysis of the two algorithms prefixAveragel and prefixAverage2 given in file PrefixAverage.java. Visualize their running times as a function of the input size with a log-log chart (A log-log chart is a two-dimensional graph where the x-coordinates and ycoordinates are logarithmic values [base of log should be same in both axes]). A log calculator can be found in https://www.calculator.net/log-calculator.htm1. Do the log-log chart using Microsoft excel and submit the screenshot of the graph. (Hint: Choose representative values of the input size n, similar to StringExperiment.java in Lesson4Examples.zip posted in the eCentennial module "Lesson Examples (from textbook)". You might like to use System class's method nanoTime( instead of the method currentTimeMillisO) )

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!