[理工] 資結請教

看板Grad-ProbAsk作者時間15年前 (2009/04/03 00:45), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/2 (看更多)
1. For the following recursive procedure RP1, (a) find RP1 (2468) = ? (b)how many times for executing the instruction print (key mod 10) in (a) ? Procedure RP1 (key: integer) begin if key < 10 then print (key); else begin print (key mod 10); RP1 (key div 10) end end 2. Considering the following program, write its recursive program. long combi (int n, int r) { int i; long p = 1; for ( i = 1; i≦r; i++) p = p*(n – i + 1)/i; return (p) ; } 3. f(x) = 2x4 + 3x3 + 5x2 + 8x + 9, what is the least number of multiplications required for evaluating f(x) ? -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 118.170.88.118
文章代碼(AID): #19rEkmcn (Grad-ProbAsk)
文章代碼(AID): #19rEkmcn (Grad-ProbAsk)