Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Re: C++ priority queue with bubble-up and bubble-down?

Thread Tools

Re: C++ priority queue with bubble-up and bubble-down?

Posts: n/a
On Aug 5, 2:25*pm, Stuart Golodetz
<(E-Mail Removed)> wrote:
> 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:riority_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

Cheers! --M
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Program blocked in Queue.Queue.get and Queue.Queue.put Kris Python 0 01-04-2012 03:46 PM
efficient priority queue for a few descrete priority levels Marcel Müller C++ 3 04-27-2009 03:22 PM
Is Queue.Queue.queue.clear() thread-safe? Russell Warren Python 4 06-27-2006 03:03 PM
Should I use shutter-priority or appurature-priority? ½ Confused Digital Photography 4 02-22-2006 09:48 AM
Question about Aperture priority and Shutter Priority John Edwards Digital Photography 8 01-05-2005 04:58 PM