考虑复发
对于且具有一些正常数,并且。T (2 )= 1
我知道用于解决递归的Master定理,但是我不确定如何使用它来解决这种关系。您如何计算平方根参数?
考虑复发
对于且具有一些正常数,并且。T (2 )= 1
我知道用于解决递归的Master定理,但是我不确定如何使用它来解决这种关系。您如何计算平方根参数?
Answers:
我们将使用Raphael的建议并展开复发。在下面,所有对数均以2为底。
其中,β(n)是必须从平方根开始以n开始并达到2的次数。结果证明,β(n)=loglogn。你怎么看?考虑: n
In your comment you mentioned that you tried substitution but got stuck. Here's a derivation that works. The motivation is that we'd like to get rid of the multiplier on the right hand side, leaving us with something that looks like . In this case, things work out very nicely:
If you write you have .
Now you know the recursion tree has hight of order , and again it's not hard to see it's in each level, so total running time is in: , which concludes for .
In all when you see or , is good to check logarithm.
P.S: Sure proof should include more details by I skipped them.
Let's follow Raphael's suggestion, for :
Edit: Thanks Peter Shor for the correction!
Unravel the recurrence once as follows:
Continuing the unraveling for steps, we have that:
These steps will continue until the base case of . Solving for we have:
Substituting into the unraveled recurrence, we have