Problem #8: How is a Queue like a Stack like a Priority Queue?
Similar
- store collections of elements
- all elements of the same type
- support an inserting operator and a removing operator
- define a structured ordering on the removal of elements (I.e., not random)
Different
- a priority queue is not a queue!
- very different orderings on elements
- pqueues require comparisons on the elements
- stacks and queues are highly efficient (pqueues slightly less so)
- theoretical computational power (pqueues and queues beat stacks