Prim 动图详解
最小生成树 (MST)
未访问
当前节点 (U)
MST 节点
检查邻居 (V)
当前状态
准备就绪。从节点 A 开始构建最小生成树。
节点表 (Cost & Parent)
NodeCost (Min Edge)ParentIn MST?
优先队列 (按 Cost 排序)