作者sads333 (阿鼎)
看板Grad-ProbAsk
標題[理工] 資料結構題目
時間Mon Dec 22 03:49:09 2014
Refer to the following execution time of programs, please evaluate
their time complexity represented in the [Big-oh] function.
(1) 59n+28
(2) 63*^2n +n^2
(3) 56n^2 +5n+15
(4) 75n + 49
抱歉題目有點多...
我的課本找不到類似這種囧rz,請問這種題目要怎麼做?
能夠交我祥解嗎
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 124.9.192.49
※ 文章網址: http://www.ptt.cc/bbs/Grad-ProbAsk/M.1419191352.A.F8E.html
→ maque: 1.O(n) 例如取 60n>=59n+28,就可已找到符合定義的c跟n0 12/22 08:58
推 maque: 第二題有點不好打,第三題可以找到56n^2+6n>=56n^2+5n+15, 12/22 09:04
→ maque: 符合定義的c跟n0,所以O(n^2) 12/22 09:04
推 galapous: 第二題乘號後面接指數? 12/22 11:17
→ galapous: 如果是63^2n的話就是O(63^2n) 12/22 11:18
→ galapous: 63^2n和n^2同取log可比較成長率 12/22 11:19