Running Time
Running Time
Many computer applications use very complex mathematical algorithms. The faster
the algorithm, the more smoothly the programs run. The running time of an algorithm
depends on the total number of steps needed to complete the algorithm. 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)=n 3+ 3 n+1
2
algorithm 2 has running time given by q(n)=15 n +5 n+4
9
(measured in nanoseconds, or 10 seconds).
Compute the running time for both algorithms for images of size 10-by-10
pixels and 100-by-100 pixels.