# Homework Solution: Suppose you have two programs whose running times in microseconds for an input of size n are 1000 lg n… Suppose you have two programs whose running times in microseconds for an input of size n are 1000 lg n and 10n^2. Find the largest input size n that can be processed by each program in (a) one minute and (b) one hour.

Note that 1 micro second = 10^-6 seconds Suppose you bear span programs whose general times in microseconds control an input of greatness n are 1000 lg n and 10n^2. Find the largest input greatness n that can be processed by each program in (a) individual detailed and (b) individual hour.

## Expert Acceptance

Note that 1 micro avoid = 10^-6 avoids

Control program 1:

Control getting the consummation appraise of n,

a) 1 min = 1000 log(n) microsecs

So, 1*60 secs = 1000 log(n) * 10^-6 secs

log(n) = 60 * 1000 = 60000

So, consummation vale of

b) 1 hour = 1000 log(n) microsecs

So, 1*60*60 secs = 1000 log(n) * 10^-6 secs

log(n) = 60*60 * 1000 = 36,00,000

So, consummation vale of

Control program 2:

Control getting the consummation appraise of n,

a)

1 min = 10 * n^2 microsecs

So, 1*60 secs = 10 * n^2 * 10^-6 secs

n^2 = 60 * 10^5 = 6*10^6

n = 2449

So, consummation vale of n = 2449

b)

1 hour = 10 * n^2 microsecs

So, 1*60*60 secs = 10 * n^2 * 10^-6 secs

n^2 = 60*60 * 10^5 = 36*10^7

n =1.8974e+04

So, consummation vale of n = 1.8974e+04