closed by
416 views
0 votes
0 votes
closed with the note: Coremen Helped!

Time Complexity of Kruskal - O(mlogm + n.O(1) + m.logn)

mlogm --> for sorting edges in increasing order.

n.O(1) --> n UNIONS as we've n nodes in G and each takes O(1)

m.logm --> Find operation takes logn time as height of tree can never me more than logn and we have m such find operations as we have m edges in G.

Now my doubt is - is it O(mlogm) or O(mlogn)? I know, given is O(mlogn), but how?

closed by

Related questions

1 votes
1 votes
1 answer
1
rahul sharma 5 asked Sep 27, 2017
565 views
Which algorithm does kruskal uses for detecting every cycle and what is the time complexity?
1 votes
1 votes
1 answer
2
1 votes
1 votes
0 answers
3
Shivam Chauhan asked Nov 2, 2017
755 views
First statement is False because complexity will be O(E2).I think the second statement is true? But not sure
0 votes
0 votes
3 answers
4
iarnav asked Apr 29, 2018
1,595 views
Question 1) The shortest-path tree computed by Dijkstra's algorithm is necessarily an MST?Question2 ) Prim's algorithm works with negative weighted edges?