The time complexity of the minimum cost spanning tree using prim’s algorithm for a graph G using binary heap is O(E log V), where E denotes the edges and V denotes the vertices of the graph G. If we implement prim’s algorithm using adjacency matrix, then the time complexity becomes O(V2).