Template Function ADS::kruskal(int, std::vector<WeightedEdge<W>>, long)

Function Documentation

template<class W>
std::vector<WeightedEdge<W>> ADS::kruskal(int n, std::vector<WeightedEdge<W>> A, long k = 0)

kruskal(): the edges of a minimum spanning forest of the nodes [ 0 , n ); with k > 0 the weights are integers in [ 0 , k ), sorted by counting

Pre:

n >= 0, the ends of the edges in [ 0 , n ), the weights in [ 0 , k ) if k > 0

Post:

a minimum spanning forest (audit)