← 回題庫

卷別

資料結構及演算法

計算

國立政治大學 2026 · 考試 · 第 11 題

考科演算法

Consider the following graph with 10 vertices A,B,C,D,E,F,G,H,I,JA, B, C, D, E, F, G, H, I, J and weighted edges:

E-J=9E\text{-}J=9, E-F=10E\text{-}F=10, J-C=5J\text{-}C=5, J-A=13J\text{-}A=13, D-C=7D\text{-}C=7, D-H=19D\text{-}H=19, D-B=2D\text{-}B=2, C-B=8C\text{-}B=8, H-B=4H\text{-}B=4, G-H=6G\text{-}H=6, G-F=15G\text{-}F=15, H-F=13H\text{-}F=13, H-I=1H\text{-}I=1, C-A=3C\text{-}A=3, A-B=12A\text{-}B=12, B-I=25B\text{-}I=25, I-F=4I\text{-}F=4.

(a) (5%) Apply Prim's algorithm, starting from node A, to construct the minimum spanning tree. List the edges of the minimum spanning tree in the exact order they are added by the algorithm. Use the format (node1, node2).

(b) (5%) State the final total weight of the constructed minimum spanning tree.

標準解析

AI 已複查