Question: Does either Prim's or Kruskal's algorithm work if there are negative edge weights? Question 7 Answer a . Neither Prim's nor Kruskal's algorithms work correctly

Does either Prim's or Kruskal's algorithm work if there are negative edge weights?
Question 7Answer
a.
Neither Prim's nor Kruskal's algorithms work correctly with negative edge weights.
b.
Kruskal's algorithm works correctly, but Prim's algorithm may produce incorrect results with negative edge weights.
c.
Both Prim's and Kruskal's algorithms work correctly with negative edge weights by replacing all the edge costs by their negatives.
d.
Prim's algorithm works correctly, but Kruskal's algorithm may produce incorrect results with negative edge weights.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!