Similarity To Queues
One can imagine a priority queue as a modified queue, but when one would get the next element off the queue, the highest-priority element is retrieved first.
Stacks and queues may be modeled as particular kinds of priority queues. In a stack, the priority of each inserted element is monotonically increasing; thus, the last element inserted is always the first retrieved. In a queue, the priority of each inserted element is monotonically decreasing; thus, the first element inserted is always the first retrieved.
Read more about this topic: Priority Queue
Famous quotes containing the word similarity:
“Incompatibility. In matrimony a similarity of tastes, particularly the taste for domination.”
—Ambrose Bierce (18421914)
Related Subjects
Related Phrases
Related Words