Consider the following statements. S1. Kruskal’s algorithm might produce a non-minimal spanning tree. S2. Kruskal’s algorithm can efficiently

Consider the following statements.
S1. Kruskal’s algorithm might produce a non-minimal spanning tree.
S2. Kruskal’s algorithm can efficiently implemented using the disjoint-set data structure.
A. S1 is true but S2 is false
B. Both S1 and S2 are false
C. Both S1 and S2 are true
D. S2 is true but S1 is false
 
Answer: d
Explanation: In Kruskal’s algorithm, the disjoint-set data structure efficiently identifies the components containing a vertex and adds the new edges. And Kruskal’s algorithm always finds the MST for the connected graph.
 

Tìm kiếm

Back
Top