标签:constant first ddc include work ext media end wiki
The master theorem concerns recurrence relations of the form:
In the application to the analysis of a recursive algorithm, the constants and function take on the following significance:
It is possible to determine an asymptotic tight bound in these three cases:
where (using big O notation)
then:
As one can see from the formula above:
Next, we see if we satisfy the case 1 condition:
It follows from the first case of the master theorem that
(indeed, the exact solution of the recurrence relation is , assuming).
If it is true, for some constant k ≥ 0, that:
then:
As we can see in the formula above the variables get the following values:
Next, we see if we satisfy the case 2 condition:
So it follows from the second case of the master theorem:
Thus the given recurrence relation T(n) was in Θ(n log n).
(This result is confirmed by the exact solution of the recurrence relation, which is, assuming .)
If it is true that:
and if it is also true that:
then:
As we can see in the formula above the variables get the following values:
Next, we see if we satisfy the case 3 condition:
The regularity condition also holds:
So it follows from the third case of the master theorem:
Thus the given recurrence relation T(n) was in Θ(n2), that complies with the f (n) of the original formula.
(This result is confirmed by the exact solution of the recurrence relation, which is , assuming .)
from wikipedia
---------------------------------------------------------------------------------------------------------------------------------------------
it means lim(n->Infinity)(f(n)/n^(b lg a)) should 1. ->Infinity && f(n)/n^(b lg a) 2. (f(n)/n^(b lg a)< n^x for x>0.
if 1 but not 2 can‘t use the method. as f(n)/n^(b lg a) = n*lgn/n = lgn.
标签:constant first ddc include work ext media end wiki
原文地址:http://www.cnblogs.com/wujunde/p/6938869.html