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
I have attached my code, under I want you to show me how to enhance it and make it more cooler and better in graphics with following the instructions.
Using R language
Using R language
Knowledge Booster
Background pattern image
Recommended textbooks for you
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Text book image
Operations Research : Applications and Algorithms
Computer Science
ISBN:9780534380588
Author:Wayne L. Winston
Publisher:Brooks Cole
Text book image
Systems Architecture
Computer Science
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Cengage Learning
Text book image
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT