Prim's Algorithm using f-heap