卷別
資料結構與演算法(A)
選擇國立臺灣大學 2022 · 考試 · 第 20 題
考科演算法
(5 points) Given a graph with the adjacent matrix with an matrix. The following algorithm can compute the All-Pairs Shortest Path of .
FLOYD-WARSHALL'(W)
1 D = W
2 for k = 1, 2, ..., n
3 for i = 1, 2, ..., n
4 for j = 1, 2, ..., n
5 d_ij = min(d_ij, d_ik + d_kj)
What is the SPACE complexity of this algorithm?
- (A)
- (B)
- (C)
- (D)
- (E)none of the other choices