Difficult# Implementing Prim's Algorithm

ALGOR-WB5YXR

You are put in charge of implementing Prim's Algorithm so that you can find a graph's minimum spanning tree.

Which of the following implementations is the most efficient way to implement this algorithm correctly?