Here it is mentioned as a queue and not a priority queue ,what would be the answer ?
Seems like O(V2)