Prim和Kruskal两种方法 // Prim // Time: O(MlogM), each edge is inserted to minHeap once. // Spcae: O(n) import java.util.*; public class Solution { public int miniSpanningTree (int n, int m, int[][] cost) { // u -> [[v1, c1], [v2, c2], ...] List<List<int[]>> graph = new Ar...