← 回題庫

卷別

資料結構與演算法(A)

選擇

國立臺灣大學 2022 · 考試 · 第 22 題

考科演算法

(5 points) Consider a fractional knapsack problem of 6 items. The ii-th item is worth viv_i dollars and weighs wiw_i pounds.

item ii123456
pounds wiw_i428558
dollars viv_i38167920

Suppose that at most W=20W = 20 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

標準解析

AI 生成