Why is the time complexity of Prim's algo when using a priority queue O(ElogV) and not O(ElogE)?

To extract the minimum from priority queue, the TC is O(logN) where N is size of priority queue. We can have more than V edges in our priority queue since we add all the edges of a vertex while visiting a vertex. I don't get why the complexity is mentioned as O(ElogV)?

Comments (1)