Re: C++ priority queue with bubble-up and bubble-down?
On Aug 5, 2:25*pm, Stuart Golodetz
> Stuart Golodetz wrote:
> > Just wondering what you'd recommend in terms of a C++ priority queue
> > implementation that supports bubble-up and bubble-down operations
> > please? std::priority_queue doesn't seem to support doing that, and I
> > couldn't find an alternative in Boost. I could write my own, but that
> > feels a little bit like reinventing the wheel, so I thought it was worth
> > asking first.
> When I said "bubble-up" and "bubble-down", what I really meant was
> increase key and decrease key (not necessarily respectively). Just to
> clarify :-)
Technically a PQ doesn't support bubble/key operations. You're wanting
a heap. Check out std::make_heap, std::sort_heap, and related
|All times are GMT. The time now is 12:52 AM.|
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.