[中學] 對數
The complexity of a problem is O(log10n) and the computer
executes 1 million instructions per second.
How long does it take to run the program if the number
of operations is 10,000?
a. 1 microsecond
b. 2 microseconds
c. 3 microseconds
d. 4 microseconds
答案是 4 microsecond
令 log(k*10*1000000)
k=1/(10^6)
10000代入之後就卡住了
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 106.104.136.224 (臺灣)
※ 文章網址: https://www.ptt.cc/bbs/Math/M.1676534698.A.F89.html
推
02/16 18:06,
2年前
, 1F
02/16 18:06, 1F
→
02/16 18:07,
2年前
, 2F
02/16 18:07, 2F
推
02/16 22:58,
2年前
, 3F
02/16 22:58, 3F
→
02/16 22:59,
2年前
, 4F
02/16 22:59, 4F
→
02/16 22:59,
2年前
, 5F
02/16 22:59, 5F
→
02/16 23:01,
2年前
, 6F
02/16 23:01, 6F
→
02/16 23:01,
2年前
, 7F
02/16 23:01, 7F
有一個問題的時間複雜度為 O(log10n)
當執行1百萬條指令花了1秒
請問執行1萬條指令,需要多少時間?
※ 編輯: magic704226 (1.161.76.127 臺灣), 02/17/2023 01:42:20
推
02/18 11:01,
2年前
, 8F
02/18 11:01, 8F
推
02/18 11:11,
2年前
, 9F
02/18 11:11, 9F
→
02/18 11:11,
2年前
, 10F
02/18 11:11, 10F
推
02/18 15:50,
2年前
, 11F
02/18 15:50, 11F
→
02/18 15:51,
2年前
, 12F
02/18 15:51, 12F
→
02/18 15:51,
2年前
, 13F
02/18 15:51, 13F
→
02/18 15:52,
2年前
, 14F
02/18 15:52, 14F
→
02/18 15:53,
2年前
, 15F
02/18 15:53, 15F
→
03/10 18:01, , 16F
03/10 18:01, 16F
→
03/10 18:03, , 17F
03/10 18:03, 17F

討論串 (同標題文章)