求緊密界線Θ - 考試
By Hedda
at 2014-07-18T13:35
at 2014-07-18T13:35
Table of Contents
在王志強資料結構[遞迴]那章節
P5-59 40題的(5)小題,求複雜度Θ
T(n) = 2T(√n) + log(n)
我的解法:
令n=(2的2的k次方) => k=log(log(n))這之後會用到
T(2的2的k次方)=2T(2的2的k-1次方)+2的k次方
令Ak=T(2的2的k次方)
PS:Ak寫法是..k在A的右小腳
得到遞迴關係式
A(k)-2A(k-1)=2的k次方
PS:括號內皆在A的右下角
改成齊次式
A(k)-3A(k-1)+2A(k-2)=0
PS:括號內皆在A的右下角
所以特徵方程式:
r的平方-3r+2=0
r=2 or 1
Ak=C1*2的k次方 + C2
因k=log(log(n))
Ak=C1*2的log(log(n))次方 + C2
=C1*log(n)的log(2)次方 + C2
=C1*log(n) + C2
=>Θ(log(n))
但解答不是log(n),是...
log(n)*log(log(n))
請問是我哪裡算錯或是答案有問題呢?
感謝!!!
--
This is SPARTA!
我只是要土和水
拿來種種花啊!!! \固
囧//☆︿異╲
█ ☆ \ by aokman
████████◤ \\ ◥██aokman███████████████
--
P5-59 40題的(5)小題,求複雜度Θ
T(n) = 2T(√n) + log(n)
我的解法:
令n=(2的2的k次方) => k=log(log(n))這之後會用到
T(2的2的k次方)=2T(2的2的k-1次方)+2的k次方
令Ak=T(2的2的k次方)
PS:Ak寫法是..k在A的右小腳
得到遞迴關係式
A(k)-2A(k-1)=2的k次方
PS:括號內皆在A的右下角
改成齊次式
A(k)-3A(k-1)+2A(k-2)=0
PS:括號內皆在A的右下角
所以特徵方程式:
r的平方-3r+2=0
r=2 or 1
Ak=C1*2的k次方 + C2
因k=log(log(n))
Ak=C1*2的log(log(n))次方 + C2
=C1*log(n)的log(2)次方 + C2
=C1*log(n) + C2
=>Θ(log(n))
但解答不是log(n),是...
log(n)*log(log(n))
請問是我哪裡算錯或是答案有問題呢?
感謝!!!
--
This is SPARTA!
我只是要土和水
拿來種種花啊!!! \固
囧//☆︿異╲
█ ☆ \ by aokman
████████◤ \\ ◥██aokman███████████████
--
Tags:
考試
All Comments
By Robert
at 2014-07-21T09:41
at 2014-07-21T09:41
By Oscar
at 2014-07-23T14:23
at 2014-07-23T14:23
By Erin
at 2014-07-26T01:30
at 2014-07-26T01:30
By Barb Cronin
at 2014-07-26T17:10
at 2014-07-26T17:10
By Edith
at 2014-07-27T06:53
at 2014-07-27T06:53
By Agnes
at 2014-07-29T08:22
at 2014-07-29T08:22
By Liam
at 2014-08-01T23:25
at 2014-08-01T23:25
Related Posts
有人是上周群倫老師的財政學嗎?
By Suhail Hany
at 2014-07-18T12:50
at 2014-07-18T12:50
後醫上榜生售書
By Joe
at 2014-07-18T12:24
at 2014-07-18T12:24
要工作還是要繼續考試?
By Kumar
at 2014-07-18T10:40
at 2014-07-18T10:40
台電雇員 答案疑義處理情形說明
By Lily
at 2014-07-18T09:45
at 2014-07-18T09:45
Wade testbank 7e
By Sandy
at 2014-07-18T08:13
at 2014-07-18T08:13