[問題] 資料結構的一些問題

看板TransCSI作者 (艾米莉)時間17年前 (2008/04/19 17:55), 編輯推噓1(101)
留言2則, 2人參與, 最新討論串1/1
有兩題資料結構的問題想要請教一下!! 題目如下: 1. Choose correct statements.(複選) (A)An algorithm must terminate after a finite number of steps. (B)An algorithm must have one or more inputs. (C)An algorithm must have one or more outputs. (D)Each step of a algorithm must be unambiguous. 2.下列程式的時間複雜度(time complexity)為何? Function testing(n) begin if(n=1) then return(2) else if(n=2) then return(4) else return(testing(n-1)+2*testing(n-2)) end (A)O(n) (B)O(n log n) (C)O(n^2) (D)O(n^3) 請各位幫忙解答囉 謝謝!! -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 203.72.144.224

04/19 18:13, , 1F
1.ACD, algorithm 定義中的五大條件去翻一下吧:")
04/19 18:13, 1F

04/19 18:33, , 2F
謝謝解答^^ 明確性被我遺忘了XD
04/19 18:33, 2F
文章代碼(AID): #182S5vIx (TransCSI)