Skip to content

Latest commit

 

History

History
11 lines (10 loc) · 594 Bytes

README.md

File metadata and controls

11 lines (10 loc) · 594 Bytes

MST-Prim

C++ implementation of Prim's algorithm for growing a Minimum Spanning Tree. I originally started off by converting the pseudocode from the book, "Introduction to Algorithms" by Cormen, Leisserson, Rivest and Stein.

But as I continued on and on, implementing datatypes as required, I moved the steps from the core function into other functions, and played with some data structures like priority_queue and pairs of pairs to get optimal performance, grouping and understandability. These changes in no way changed the algorithm at heart, and works flawlessly under every test case.