// run Prim's algorithm in graph G, starting from vertex s private void Prim(EdgeWeightedGraph G, int s) { distTo[s] = 0.0; pq.Insert(s, distTo[s]); while (!pq.IsEmpty()) { pq.DelMin(out int v, out double dist); Scan(G, v); } }
public bool HasNext() { return(!copy.IsEmpty()); }