title: Complexity of Prims Algorithm using Priority Queue?
body: <p>I am using an adjacency matrix, priority queue is the data structure.</p>
  
  <p>By my calculation, complexity is <code>V^3 log V</code>:</p>
  
  <ul>
  <li>While loop: <code>V</code></li>
  <li>Checking adjacent Vertices: <code>V</code></li>
  <li>Checking the queue if the entry is already present, and updating the same: <code>V log v</code></li>
  </ul>
  
  <p>But, I read everywhere that the complexity is <code>V^2</code></p>
  
  <p>Please explain. </p>