Prim's Algorithm
Starts from an arbitrary vertex.
Grows one connected MST.
Priority queue is commonly used.
With binary heap and adjacency list: O(E log V).
Suitable for dense graphs with appropriate implementations as well.
Share via WhatsApp, X, Facebook, LinkedIn or copy link. Open Graph preview enabled.