Article View: pl.comp.objects
Article #14703Re: reorganizacja kolejki priorytetowej STL po modyfikacji elementu
From: Kralu
Date: Thu, 25 May 2006 09:08
Date: Thu, 25 May 2006 09:08
23 lines
2036 bytes
2036 bytes
gnustikos wrote: > Moje pytanie brzmi oczywiscie, jak to zrobic najszybciej i/lub > najoptymalniej? Nie jestem specem od STL'a i nie znalazlem w > manualu tej kolejki nic, co by mnie usatysfak- cjonowalo, a > grzebanie w jakichs niskopoziomowych funkcjach operowania na kopcu > byloby dla mnie problematyczne. Moze to Ci pomoze: (z http://www.sgi.com/tech/stl/priority_queue.html) "[2] This restriction is the only reason for priority_queue to exist at all. If iteration through elements is important, you can either use a vector that is maintained in sorted order, or a set, or a vector that is maintained as a heap using make_heap, push_heap, and pop_heap. Priority_queue is, in fact, implemented as a random access container that is maintained as a heap. *The only reason to use the container adaptor priority_queue, instead of performing the heap operations manually, is to make it clear that you are never performing any operations that might violate the heap invariant*." Pozdrawiam. -- Marcin Kral
Technical Details
Message-ID:
<e53s7r$lr3$1@atlantis.news.tpi.pl>Path:
mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!newsfeed.gazeta.pl!news.nask.pl!news.nask.org.pl!newsfeed.tpinternet.pl!atlantis.news.tpi.pl!news.tpi.pl!not-for-mailReferences:
<1148473562.518662.112460@i40g2000cwc.googlegroups.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!newsfeed.gazeta.pl!news.nask.pl!news.nask.org.pl!newsfeed.tpinternet.pl!atlantis.news.tpi.pl!news.tpi.pl!not-for-mail From: Kralu <kralu@beztego.poczta.onet.pl> Newsgroups: pl.comp.lang.c,pl.comp.programming,pl.comp.objects Subject: Re: reorganizacja kolejki priorytetowej STL po modyfikacji elementu Date: Thu, 25 May 2006 11:08:53 +0200 Organization: tp.internet - http://www.tpi.pl/ Lines: 23 Message-ID: <e53s7r$lr3$1@atlantis.news.tpi.pl> References: <1148473562.518662.112460@i40g2000cwc.googlegroups.com> NNTP-Posting-Host: cgq62.neoplus.adsl.tpnet.pl Mime-Version: 1.0 X-Trace: atlantis.news.tpi.pl 1148548155 22371 83.30.244.62 (25 May 2006 09:09:15 GMT) X-Complaints-To: usenet@tpi.pl NNTP-Posting-Date: Thu, 25 May 2006 09:09:15 +0000 (UTC) User-Agent: Thunderbird 1.5.0.2 (Windows/20060308) In-Reply-To: <1148473562.518662.112460@i40g2000cwc.googlegroups.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit