看板 Examination 關於我們 聯絡資訊
for i=0 to n do //是O(n+1) begin j=i; //這邊是O(n)嗎 while j >0 do j=j/2; //這邊寫在同一行,所以算O(log n)還是while判斷也要算? end 謝謝 -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 54.183.135.27 ※ 文章網址: https://www.ptt.cc/bbs/Examination/M.1493935341.A.4F9.html
Leadgen: O(nlogn)是嗎? 05/05 11:38
wei371114: O(log n) 和(2log n)的差別是?建議原po再對big o 的定 05/05 11:46
wei371114: 義看一下@@ 以及O(n+1) 和 O(n) 05/05 11:46
wei371114: 剛接觸這類問題 建議你把明確的總次數清楚算出來 05/05 11:47