Query regarding MSTs

So Prim’s and Kruskal’s algorithm have the same time complexity , right?
Can someone give me a scenario where it is beneficial to use Prim’s over Kruskal’s or the other way round?

Time Complexity of Kruskal’s:- O(ElogV)
Time Complexity of Prim’s:- O(VlogV+ElogV)
You might be wondering, it’s same, Yup, it is :slightly_smiling_face:.

But if u use Fibonacci Heaps in Prim’s algo, the time complexity can be reduced to O(E+logV)

Didn’t know anything like Fibonacci heaps existed. XD.
Anyway thanks mate!

I too came to know about this today only