Implemented Prim's Algorithm using a binary heap.