試卷名稱:104年 - 104 國立交通大學_碩士班考試入學試題_資訊聯招:資料結構與演算法#113199
年份:104年
科目:研究所、轉學考(插大)◆資料結構與演算法
39. A hiker faces the Knapsack problem. There are 7 items to be packed into the knapsack, each with value viand weight wi as shown in the following table.

The knapsack, which is initially empty, can hold a maximum weight of 16, so some item(s) must be left
behind. The optimality criterion is to maximize the total value of the items that are placed in the knapsack.The hiker fills the knapsack one item at a time. Now consider the following two cases: (a) fractions of items cannot be packed, and (2) fractions of items can be packed. What are the optimal values of the items that are packed in these two cases respectively?
Give the answer in the form of (no-fractions-allowed, fractions-allowed).
(A)(28,30.5)
(B)(37,40)
(C)(30,34)
(D)(38,40)
(E)(34,38.5)