AlgoFrames

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