191k views
5 votes
• Suppose that a particular algorithm has time complexity T(n) = 10 ∗ 2n, and that execution of the algorithm on a particular machine takes T seconds for n inputs. Now, suppose you are presented with a machine that is 64 times as fast as your current machine. How many inputs can you process on you new machine in T seconds?

User Crown
by
5.7k points

1 Answer

4 votes

Answer:

The number of inputs processed by the new machine is 64

Solution:

As per the question:

The time complexity is given by:


T(n) = 10* 2n

where

n = number of inputs

T = Time taken by the machine for 'n' inputs

Also

The new machine is 65 times faster than the one currently in use.

Let us assume that the new machine takes the same time to solve k operations.

Then

T(k) = 64 T(n)


(T(k))/(T(n)) = 64


(20k)/(20n) = 64

k = 64n

Thus the new machine will process 64 inputs in the time duration T

User Szymon Toda
by
5.4k points