If an algorithm with input n can solve a problem in fn milli
If an algorithm with input n can solve a problem in f(n) milliseconds. What is the effect in the time if you try to solve a problem with input 2n? (That is, to express f(2n) by using f(n))
a) f(n)=100n
b) f(n)=n^2
c) f(n)=2n
d) f(n)=log n
Solution
answer:
now the n value is increased by 2and that can be depicted as 2n, finally that raises the computational ratio time as 2 2n / 2 n = 2 n .
from this we can conclude that, the time is 2 n time when the i/p is getting doubled in its size.
