Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Numerical Analysis

Authors: Richard L. Burden, J. Douglas Faires

9th edition

538733519, 978-1133169338, 1133169333, 978-0538733519

More Books

Students also viewed these Mathematics questions

Question

Why is there emphasis on nonprice competition in oligopoly?

Answered: 1 week ago

Question

3. What factors define a strong consumer- brand relationship?

Answered: 1 week ago