Cost of the array version
Standard · Work out the cost · about 4 min
This Prim keeps an array of keys instead of a heap. The graph has n vertices and is given as an n × n matrix. Pick its time and extra space complexity.
Learn the idea first: Prim's algorithm, a visual lesson.
More Prim's algorithm problems
- Prim order Warm-up
- Kruskal vs Prim Warm-up
- Implement Prim Standard
- Supply water to every house Standard
- MST on a dense matrix graph Challenge