PCDVD數位科技討論區

PCDVD數位科技討論區 (https://www.pcdvd.com.tw/index.php)
-   七嘴八舌異言堂 (https://www.pcdvd.com.tw/forumdisplay.php?f=12)
-   -   [求救]演算法分析... (https://www.pcdvd.com.tw/showthread.php?t=910429)

.好噁心. 2010-11-16 10:52 AM

[求救]演算法分析...
 
一個很簡單的題目
可是我就是想不通..@.@
請神人幫幫我..
真的非常感激

Big-O多項式,試找出 c 和 n0 使其符合 f(n) <= c * g(n)
1000 * n2 + 100n+ 8

我算出C = 1108
n0=1

可是書上答案 C = 2000 n0=1
為何..@.@ ..

michelle-lai529 2010-11-16 11:03 AM

想不起來了,恕刪.....

powercd 2010-11-16 05:20 PM

請參考...(怎麼題目一模一樣?)

http://www.programmer-club.com.tw/s...ework/4427.html

bxxl 2010-11-16 05:59 PM

如果沒有限制C要找符合條件中的最小值, 那有多組答案也是正常的.
最小的C是最高階的係數+1.

.好噁心. 2010-11-16 06:10 PM

引用:
作者powercd
請參考...(怎麼題目一模一樣?)

http://www.programmer-club.com.tw/s...ework/4427.html


對阿
題目一樣
但是他算出的答案是
C=1001
n > 101

答案跟我的有出入..@.@
跟書上頁有出去


所有的時間均為GMT +8。 現在的時間是03:06 AM.

vBulletin Version 3.0.1
powered_by_vbulletin 2025。