Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem 1. Roughly how long will it take for a linear time algorithm to run? What about a quadratic time algorithm? Or worse, a cubic?

image text in transcribed

Problem 1. Roughly how long will it take for a linear time algorithm to run? What about a quadratic time algorithm? Or worse, a cubic? In this problem, we'll estimate these times. Suppose algorithm A takes n microseconds to run on a problem of size n, while algorithm B takes n2 microseconds and algorithm C takes n3 microseconds (recall that a microsecond is one millionth of a second). How long will each algorithm take to run when the input is of size one thousand, ten thousand, one hundred thousand, and one million? That is, fill in the following table: The answers for Algorithm A are already provided; you can use them to check your strategy. Express each time in either seconds, minutes, hours, days, or years. Use the largest unit that you can without getting an answer less than one. For example, instead of " 365 days", say "1 year"; but use " 364 days" instead of "0.997 years". Round to two decimal places (it's OK for an answer to round to 0.00 ). Hint: you can calculate your answers by hand, or you can write some code to compute them. If you write code, provide it with your solution - if you solve by hand, show your calculations

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

Business Process Driven Database Design With Oracle PL SQL

Authors: Rajeev Kaula

1st Edition

1795532386, 978-1795532389

Students also viewed these Databases questions

Question

6. Conclude with the same strength as in the introduction

Answered: 1 week ago

Question

7. Prepare an effective outline

Answered: 1 week ago