~ Office Supplies ~~ Buy Posters ~~ A-Z Products ~~ Website Advertising


Priority queue - Wikipedia

<<Up     Contents

Priority queue

A priority queue is an abstract data type supporting the following two operations:

The simplest way to implement a priority queue is with an array of records containing elements and priorities, along with a count that tells how many elements of the array are used; adding an element involves incrementing that count and writing the new element and priority into the previously unused slot; removing the element requires searching through the array for the element with the highest priority, copying the last element into its slot, and decrementing that count.

This makes removing an element O(n) in the number of elements in the queue, which is somewhat inefficient if the queue gets large; a heap is a more efficient way to implement a priority queue for a large number of elements.

See also: scheduling

wikipedia.org dumped 2003-03-17 with terodump




 
 
158 carats gray AGATE gem Polished slab rectangle block Cabbing cab cabochon rough gemstone 31 grams
 158 carats gray AGATE Polished slab rectangle block Cabbing cab cabochon 31 grams 
 
30 gram picture MOONSTONE feldspar orthoclase gem Cab cabochon raw rough jewelry gemstone 154 carat
 30 gram picture MOONSTONE feldspar orthoclase Cab cabochon raw jewelry 154 carat 
 
15 carats yellow Oregon SUNSTONE gem stones Semi Facet cabbing rough gemstones lot Faceting jewels
 15 carats yellow Oregon SUNSTONE Semi cabbing lot ing jewels 
 
Red green AMMOLITE gem stone Freeform cabochon cabbing jewelry rough Ammonite opal 10 carats 2 grams
 Red green AMMOLITE Freeform cabochon cabbing jewelry Ammonite opal 10 carats 2 grams 
 
22 carat green new jade Serpentine rough gemstone tumble polished nugget drilled necklace bead Nice
 22 carat green new jade Serpentine tumble polished nugget drilled necklace bead Nice