卷別
資料結構與演算法(A)
選擇國立臺灣大學 2022 · 考試 · 第 22 題
考科演算法
(5 points) Consider a fractional knapsack problem of 6 items. The -th item is worth dollars and weighs pounds.
| item | 1 | 2 | 3 | 4 | 5 | 6 |
|---|---|---|---|---|---|---|
| pounds | 4 | 2 | 8 | 5 | 5 | 8 |
| dollars | 3 | 8 | 16 | 7 | 9 | 20 |
Suppose that at most pounds can be carried in the knapsack. The sequence of picking the items is
- (A)2, 6, 3, 5
- (B)2, 6, 5, 3
- (C)2, 6, 5, 4, 3
- (D)6, 3, 5, 2, 4
- (E)none of the other choices