How are these done


Consider an undirected connected graph with four vertices: v1,v2,v3,v4 and five weighted edges described by the adjacency matrix V, see below. The entry vi,j in the matrix is the weight of the edge from the vertex vi to the vertex vj Pseudocode: Initialize A as an empty set for (each vertex v∈V ) Make_Set (v) sort edge weights in increasing order for (each edge (u,v)∈E in sorted order) if (Find_Set (u)!= Find_Set (v) ) add the edge (u,v) to the set A Union (u,v) return A How many times the disjoint set operation Find_Set() is called during the process of building MST for this graph, see the pseudocode above? 2 4 6 8 10 12
Consider an undirected connected graph with four vertices: v1,v2,v3,v4 and five weighted edges described by the adjacency matrix V, see below. The entry vi,j in the matrix is the weight of the edge from the vertex vi to the vertex vj. Pseudocode: Initialize A as an empty set for (each vertex v∈V ) Make_Set (v) sort edge weights in increasing order for (each edge (u,v)∈E in sorted order) if (Find_Set (u) != Find_Set (v) ) add the edge (u,v) to the set A Union (u,v) return A How many times the disjoint set operation Union() is called during the process of building MST for this graph, see the pseudocode above? 1 2 3 4