Re: [理工] 資料結構 Big-O 計算

看板Grad-ProbAsk作者 (夜の星)時間8年前 (2016/04/18 16:00), 編輯推噓1(101)
留言2則, 2人參與, 最新討論串2/2 (看更多)
※ 引述《garyhsu1209 (良師)》之銘言: : give a big-O estimate for the number of operations (where an operation is an : addition or a multiplication) used in this segment of an algorithm. Try to : give the tightest possible polynominal function. : 1. t:=1 : 2. for i=n to n^2 do : 3. for j=1 to n^300 do : 4. t:= t+t+1000 : 5. t = t+100 : 6. end for : 7. t:= t+t : 8. t = t+7 : 9. end for http://i.imgur.com/RET0Fp0.png
用Summation的作法不知道是不是長這樣@@ j迴圈下有2個指令,接著j迴圈用一個sigma,i迴圈再用一個 計算到最後取big-oh 如有錯誤懇請指正 謝謝! -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 122.22.71.225 ※ 文章網址: https://www.ptt.cc/bbs/Grad-ProbAsk/M.1460966426.A.051.html

04/23 00:45, , 1F
真的看解答都很簡單,看到類似的又不會寫了
04/23 00:45, 1F

05/23 01:31, , 2F
程式寫出來就知道了
05/23 01:31, 2F
文章代碼(AID): #1N59GQ1H (Grad-ProbAsk)
文章代碼(AID): #1N59GQ1H (Grad-ProbAsk)