+ 3
Can anyone tell me about running time of kruskal's algorithm and prims algorithm?
From internet i can't get any reasonable information.
2 Réponses
+ 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
+ 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?