What DS does Prim’s algorithm work?
Priority Queue to store the edges and Array to track if a vertex has been visited.
How does Prim’s algorithm work?
Time Complexity of Prim’s
O(ElogV)
What DS does Kruskal’s algorithm use?
UFDS and Edge List
How does Kruskal’s algorithm work?
Keep picking the edge of lowest weight to be part of the MST, with the condition that the edge must be connecting our current tree to a previously connected vertex, until all vertices are connected to the tree.
Time Complexity of Kruskal’s
O(ElogV)
How to find the minimax path from a to b?
Find the MST and find the path between a and b. This is the minimax path between a and b.
Properties of a graph where you’d find MST
Connected, undirected, weighted