← 回題庫

卷別

資料結構與演算法(A)

選擇

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

考科演算法

(5 points) Dynamic programming can be used to solve the matrix-chain multiplication problem. Suppose we hope to compute the matrix product A1A2…A6A_1 A_2 \dots A_6 with the matrix dimensions as follows.

matrixA1A_1A2A_2A3A_3A4A_4A5A_5A6A_6
dimension30×3530\times3535×1535\times1515×515\times55×105\times1010×2010\times2020×2520\times25

Let m[i,j]m[i, j] be the minimum number of scalar multiplications needed to compute the matrix AiAi+1…AjA_i A_{i+1} \dots A_j. What is m[2,5]m[2, 5]?

  • (A)
    4375
  • (B)
    7125
  • (C)
    5375
  • (D)
    8500
  • (E)
    none of the other choices

標準解析

AI 生成