I was looking at the Wikipedia entry for Prim\'s algorithm and I noticed that its time complexity with an adjacency matrix is O(V^2) and its time complexity with a heap and
From the Introduction to Algorithms (Carmen)
Time= Θ(V)·T(EXTRACT-MIN) + Θ(E)·T(DECREASE-KEY)
T(EXTRACT-MIN) T(DECREASE-KEY) Total
1. array O(V) O(1) O(V^2)
2. binary heap O(lgV) O(lgV) O(E lgV)
3. Fibonacci heap O(lgV) O(1) O(E + VlgV)
Using different data structures causes different time complexities.