T
thomas
I want to use a priority_queue like STL data structure.
But I found that priority_queue cannot update element value: only pop/
push is supported.
I'm using priority_queue to implement the prim MST algorithm.
So I need the priority_queue to contain the key[] values for each
vertex not included in the final tree. Of course the pop and push
operation is what I need, but I also need to update the weight value.
Can I use priority_queue to make it work?
Or any other way to use existing STL containers to implement the prim
MST algorithm?
But I found that priority_queue cannot update element value: only pop/
push is supported.
I'm using priority_queue to implement the prim MST algorithm.
So I need the priority_queue to contain the key[] values for each
vertex not included in the final tree. Of course the pop and push
operation is what I need, but I also need to update the weight value.
Can I use priority_queue to make it work?
Or any other way to use existing STL containers to implement the prim
MST algorithm?