Given a connected, undirected, and weighted graph represented as an adjacency list, implement Prim's algorithm to find the Minimum Spanning Tree (MST) and return the total weight of the MST.
You've read your 3 free write-ups
Sign up free to keep reading. Your account opens the first 10 questions of every company.