Prim’s Algorithm in C++