Can anyone tell me about running time of kruskal's algorithm and prims algorithm? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

Can anyone tell me about running time of kruskal's algorithm and prims algorithm?

From internet i can't get any reasonable information.

27th Jun 2020, 9:52 AM
Mehwish
Mehwish - avatar
2 Answers
+ 2
can you even implement the algo and analyze the complexity yourself? if you can do the former then you can do the latter if not go read your algo textbook again I’ll just give you 2 answers: a. without dsu O(n+m) b. with dsu O(m log n) I’ll let you figure yourself what m and n are
27th Jun 2020, 10:50 AM
Bobby Fischer
Bobby Fischer - avatar
+ 2
I have done this by myself but the ans is O(e log v) for both but i can't understand how they come and plz tell me that they both havs same running time or its time depends on data structure like if we implement it theough array or any other?
27th Jun 2020, 3:58 PM
Mehwish
Mehwish - avatar