Question: 3. Suppose that an algorithm uses 10n + 2 basic operations to solve a problem of size n. Suppose that your machine can perform one

3. Suppose that an algorithm uses 10n + 2" basic operations to solve a problem of size n. Suppose that your machine can perform one basic operation in 10-3 seconds, how long does it take your algorithm to solve a problem of size given below. Note, if your algorithm takes more than 60 seconds, answer in minutes. For more than 60 minutes, answer in hours. For more than 24 hours, answer in days. For more than 365 days, answer in years. For more than 100 years, answer in centuries! You can assume that there are 365 days in a year. (a) n = 10 (b) n = 40 (c) n = 60 (d) n = 100 (e) What if we had two algorithms, A and B. Algorithm A uses 1.05" basic operations to solve a problem of size n and Algorithm B uses n' basic operations. Suppose that your machine can perform one basic operation in 10-3 seconds. Which of these Algorithms should we run if our input size is n = 1000? Justify your answer by expressing the time taken for each Algorithm (in seconds, minutes, hours, days, years or centuries as appropriate)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
