Prims Algorithm implementation in c++.