We have packaged the algorithms ThreeSumFast and ThreeSum, in a jar file that yo
ID: 3883448 • Letter: W
Question
We have packaged the algorithms ThreeSumFast and ThreeSum, in a jar file that you can download from (https: //github.com/idl020/lab2-runningtimes/blob/master/ runningtimes.jar?raw=true). Also, a simple program has been added to measure the execution time of each of the algorithms for some given input. For example, if you want to measure the time taken by TwoSum for a file of 1000 numbers, you should run > java -jar runningtimes jar 2sum 1000 1000 0.006 The program prints back the input size which is 1000 and the time taken which is 0.006 seconds. Estimate the amount of time it would take to run ThreeSumFast and ThreeSum, on your computer to solve the problems for a file of 1048576 numbers. Notice that measuring the execution time is not feasible for all points, so you have to think about predicting time for those point you can't measure. Answer with at least 50 words to explain which of the alternatives are correct: a) milliseconds or seconds b) minutes or hours c) hours or days d) days or months e) yearsExplanation / Answer
Ans: (A)
The maximum execution time, in seconds
Set the number of seconds a script is allowed to run. If this is reached, the script returns a fatal error. The default limit is 30 seconds. if u have want to set the time for excution u can set time for excution but it is always in seconds.
When called, set_time_limit() restarts the timeout counter from zero. In other words, if the timeout is the default 30 seconds, and 25 seconds into script execution a call such as set_time_limit(20) is made, the script will run for a total of 45 seconds before timing out.
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.