Question: There are two algorithms called Alg 1 and Alg 2 for a problem of size n . Alg 1 runs in n 2 microseconds and
There are two algorithms called Alg and Alg for a problem of size n Alg runs in n microseconds and Alg runs in n log n microseconds. Alg can be implemented using hours of programmer time and needs minutes of CPU time. On the other hand, Alg requires hours of programmer time and minutes of CPU time. If programmers are paid dollars per hour and
CPU time costs dollars per minute, how many times must a problem instance of size be solved using Alg in order to justify its development cost?THE LAST SENTENCE IN THIS CONTENT NEEDS THE ACTUAL SOLUTION
Now,
cx ;
cx;
nx ; n logn x;
putting x we get,
x ;logx;
x ;
logx ;
x logx ;
x x
x
x
Hence, the program must be run times to justify the development cost of the Algorithm
"Compile time was not accounted in your fixed cost."
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
