array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'de', ), 'this' => array ( 0 => 'class.ds-priorityqueue.php', 1 => 'Ds\\PriorityQueue', ), 'up' => array ( 0 => 'book.ds.php', 1 => 'Data Structures', ), 'prev' => array ( 0 => 'ds-queue.toarray.php', 1 => 'Ds\\Queue::toArray', ), 'next' => array ( 0 => 'ds-priorityqueue.allocate.php', 1 => 'Ds\\PriorityQueue::allocate', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/ds/ds.priorityqueue.xml', ), 'extra_header_links' => array ( 'rel' => 'alternate', 'href' => '/manual/en/feeds/class.ds-priorityqueue.atom', 'type' => 'application/atom+xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PECL ds >= 1.0.0)
A PriorityQueue is very similar to a Queue. Values are pushed into the queue with an assigned priority, and the value with the highest priority will always be at the front of the queue.
Implemented using a max heap.
Hinweis:
"First in, first out" ordering is preserved for values with the same priority.
Hinweis:
Iterating over a PriorityQueue is destructive, equivalent to successive pop operations until the queue is empty.