title: Time Complexity of (Minimum Spanning Tree) Prim's Algorithm
body: <p>When we implement this algorithm using adjacency matrix and without using priority queue, the time complexity comes out to be O(V^2), where V is the total no. of vertices and E is the total no. of edges.</p>
  <p>But when we implement it using priority queue(using binary heap) and adjacency list, the time complexity comes out to be O((V + E)*logV).</p>
  <p>How is this T.C. better than O(V^2) as in worst case E = O(V^2) ?</p>
  <p>I am not able to get it. Please clarify my doubt.</p>