Prim's Algorithm for finding Minimum cost Spanning Tree