Question: 1 9 ) Consider two programs implementing algorithms A and B , trying to solve the same problem for an input of size n .

19) Consider two programs implementing algorithms A and B, trying to solve the same problem for an input of size n. They measured the execution times for test cases of different sizes and tabulated them as follows. Which program is more efficient? Why?
Algorithm n =100 n =200 n =300 n =400 n =500
A 0.003s 0.36s 0.36s 0.24s 0.053s
B 0.040s 0.160s 0.360s 0.640s 1.000s

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!