• retagged by
2,516 views
2 2 votes
Can Prim's and Kruskal's algorithm yield different minimum spanning trees? Explain why or why not.

3 Answers

2 2 votes
Yes, In case if they have more than one Spanning Tree

But the cost of Both tree is Same
0 0 votes

It's true tat only the procedure is different. However in Krushkal's algorithm sorting is done as regards the minimum edge is taken first. But in Prim's algorithm this is not done. The major difference takes occurs when their comparison is made on the basis of time complexity. The resultant minimum spanning tree which is obtained is the same. 

Please kindly refer the link below for more detailed explanation which are given as under:

http://www.geeksforgeeks.org/greedy-algorithms-set-2-kruskals-minimum-spanning-tree-mst/

http://www.geeksforgeeks.org/greedy-algorithms-set-5-prims-minimum-spanning-tree-mst-2/

Hope it helps u. :)

Position:
Show:

Related questions

1 1 vote
1 answers 1 answer
1.3k
1.3k views
Debargha Mitra Roy asked Aug 25, 2024
1,252 views
Which of the statement is/are correct?(a) First edge added by Kruskal’s algorithm can be the last edge added by prim’s algorithm(b) In a graph, if one raises the length o...
5 5 votes
1 1 answer
2.6k
2.6k views
sunil sarode asked Jan 2, 2018
2,555 views
Given graph using Prim’s or Kruskal’s algorithm, find out that how many distinct minimum cost spanning trees are possible___?My answer was 1 and given is 2 ,what I am mi...
3 3 votes
1 answers 1 answer
3.9k
3.9k views
Pooja Palod asked Oct 15, 2015
3,857 views
Suppose that edge weights are uniformly distributed over half open interval $[0,1)$. Which algorithm kruskal's or prim's can make you run faster?
3 3 votes
2 answers 2 answers
2.6k
2.6k views
DeadMann asked Jun 24, 2023
2,605 views
Can anyone help in solving the question 105 to 109.I don't have answer key I want to confirm my answer ...i will update my answer in the comments.