Question: 38. Many computer applications use very complex mathe- atical algorithms. The faster the algorithm, the more smoothly the programs run. The running time of an

38. Many computer applications use very complex mathe- atical algorithms. The faster the algorithm, the more smoothly the programs run. The running time of an al- gorithm depends on the total number of steps in the al- gorithm. For image processing, the running time of an algorithm increases as the size of the image increases. For an n-by-n image, algorithm 1 has running time given by p(n) = n3 + 3n + 1 and algorithm 2 has run- ning time given by q(n) = 1 5n2 + 5n + 4 (measured in nanoseconds, or 10-9 seconds). (a) Compute the running time for both algorithms for images of size 10-by-10 pixels and 100-by-100 pixels. (b) Graph both running time polynomials in an appro- priate window (or several windows if necessary). (c) Which algorithm is more efficient
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
