Introduction to Algorithms
Introduction to Algorithms
3rd Edition
ISBN: 9780262033848
Author: Thomas H. Cormen, Ronald L. Rivest, Charles E. Leiserson, Clifford Stein
Publisher: MIT Press
Question
100%
Book Icon
Chapter 1, Problem 1P
Program Plan Intro

To complete the table for given function f(n) and time t .

Expert Solution & Answer
Check Mark

Explanation of Solution

Given Information:The time taken by algorithm to solve the problems in f(n) microseconds.

Explanation:

Since 1 microsecond is equal to 106 seconds. Therefore, 1 second is equal to 106 microseconds.

Consider the function f(n)=lg(n) . Now, determine the value of n such that lgn<106

as follows:

lgn<1062lgn<2 106n<2 106

Therefore, the value of n is 2106 for 1 second.

Since 1 hour is equal to 3600 seconds. Therefore, 1 hour is equal to 3.6×109 microseconds.

Again, consider the function f(n)=lg(n) . Now, determine the value of n such that lgn<3.6×109

as follows:

lgn<3.6×1092lgn<23.6× 109n<23.6× 109

Therefore, the value of n is 23.6×109 for 1 hour.

Consider a month is equal to 30 days and a year is equal to 365 days.

Similarly, calculate the other values of t in the different functions f(n) to obtain the correspondinglargest values of n .

Complete the table for different values of n

as follows:

    f(n)1 second1 minute1 hour1 day1 month1 year1 century
    lgn210626×10723.6×10928.64×101022.592×101223.15×101323.16×1015
    n1×10123.6×10151.29×10197.46×10216.72×10249.95×10269.95×1026
    n1×1066×1073.6×1098.64×10102.59×10123.15×10133.16×1015
    nlgn6274628014171333780582755147513718708564047976338933496.86×1013
    n210007745600002939381609968561569256176151
    n3100391153244201373631593146679
    2n19253136414451
    n!9111213151617

Table 1

Want to see more full solutions like this?

Subscribe now to access step-by-step solutions to millions of textbook problems written by subject matter experts!
Students have asked these similar questions
The search algorithm developed will be used for users to search the catalog for all items matching the search keyword(s), and there are a total of 15000 items in the catalog. During development, three different algorithms were created. • Algorithm A runs in constant time, with a maximum runtime of 1.10 seconds and returns all matching results. ● Algorithm B runs in logarithmic time, with a maximum runtime of 0.3 seconds, and returns only the first result. ● Algorithm C runs in linear time, with a maximum runtime of 1.50 seconds and returns all matching results. Which algorithm would be the least suitable for the requirements stated? In your answer, justify your choice by explaining why you picked that algorithm, and why you did not pick the other two algorithms.OND OND OND DAD
Algorithm X has a growth rate that is proportional to n ∗ n ∗ n  . What is the function that represents the growth rate of algorithm X?  What is the order of algorithm X?
3) For each function f(n) and time t in the following table, determine the largest size n of a problem that can be solved in timet, assuming that the algorithm to solve the problem takes f (n) microseconds. 1 1 second minute hour day month year century lgn n n lg n n2 n3 2" п!
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education