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

a.) Suppose we have a method whose worstTime(n) is linear in n. Estimate the eff

ID: 441451 • Letter: A

Question

a.) Suppose we have a method whose worstTime(n) is linear in n. Estimate the effect of tripling n on run time--- the actual time to execute the method in a particular computing environment. That is, estimate runTime(3n) in terms of runTime(n). b.) Suppose we have a method whose worstTime(n) is quadratic in n. Estimate the effect of tripling n on run time--- the actual time to execute the method in a particular computing environment. That is, estimate runTime(3n) in terms of runTime(n). c. Suppose we have a method whose worstTime(n) is constant. Estimate the effect of tripling n on run time--- the actual time to execute the method in a particular computing environment. That is, estimate runTime(3n) in terms of runTime(n).

Explanation / Answer

a. runTime(3n)=3*runTime(n) b.runTime(3n)=9*runTime(n) c.runTime(3n)=runTime(n) (no change