[理工] [軟設]-中正96-資工

看板Grad-ProbAsk作者 (最後掙扎J)時間15年前 (2010/03/23 21:33), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/2 (看更多)
12. (a) Given an array A of N positive integers and an integer M write a recursive C function int sos(int A[], int N, int M) which returns 1 if there exists a subset of numbers in A whose sum is equal to M and returns 0 otherwise. Your function should not exceed 15 statements. 是用類似Dynamic programming的概念去找嗎? 想了想還是想不出來...OTL 請幫忙解惑<(_ _)> 謝謝!! -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.138.226.62 ※ 編輯: alibudaken 來自: 140.138.226.62 (03/23 21:34)
文章代碼(AID): #1BgCCTrf (Grad-ProbAsk)
文章代碼(AID): #1BgCCTrf (Grad-ProbAsk)