作者kiwidoit (橘子愛玉~>_^)
看板Grad-ProbAsk
標題[理工] [Alogrithm] [Amortized analysis]
時間Sat Jul 30 01:10:37 2011
題目如下:
We know that the runtime complexity of a program depends on the program
input combinations --- Suppose the probability of the program with runtime
complexity O(n) is p, where p << 1, and in other cases (i.e for the (1-p)
possible cases), the runtime complexity is O(logn). If we are running the
program with K different input combinations, where K is a very large number,
we can say that the amortized runtime complexity of this program is:
(A) O(logn)
(B) O(p*n)
(C) O(K*logn)
(D) O(K*p)
(E) O(K*pn)
這一題我想了很久很久> <"
感覺應該是C,可是又不確定
誰能教一下...
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.123.235.119
推 wheels:我覺得是B耶...雖然O(n)的case少,但是當K夠大時它的case也 07/30 01:55
→ wheels:跟著變多了,所以要用O(n)=O(pn)才蓋得住它 07/30 01:57
→ wheels:但是我完全不確定這是不是正確答案=_= 07/30 01:58
→ Byzantin:我也覺得是B @@ 其他選項不可能 07/30 09:23
→ kiwidoit:有沒有人可以用攤銷的方式去解它QAQ? 07/30 13:55
→ Byzantin:題目來源? 07/30 16:22
→ Byzantin:其實B也不像正確答案.. 07/30 16:32
→ kiwidoit:台大電機丙100年DS考古題第三題 07/30 17:19
→ Byzantin:咦 網站上找不到 07/30 17:25
→ kiwidoit:要去台大新版的考古題網站 07/30 17:30