I have a question.
I'm working on an implementation on Prim's algorithm currently, and I need an appropriate container.
Since I need to find the lowest cost edge, I wanted a container that could effectively sort the data to keep them in a sorted order, so that I could take the first edge, check if it's one I can use, and if not, pick the next lowest weight, and so on.
I have thought about priority queues. Only, they lack iterators. That means I would have to pop the front, check it, then push it if it doesn't fit what I need. And then it appear in the front again.
A binary heap wouldn't necessarily keep the items in sorted order, nor do I think they have iterators, so that wouldn't do either. Or if it did, it would probably be a little more complicated.
Another option, I suppose, would be some queue I could sort of a linked list to which I apply mergesort, since from my experiements, it's pretty fast on sorted data.
Those are my thoughts.
Now I want to know if anyone else has any ideas or thoughts.