next up previous
Next: About this document ... Up: Assignment 3: Priority Queues Previous: Make a generic Priority

A little thinking

In the array implementation of the Priority Queue, what happens if you add two items with the same key? Which one of them gets removed first. What about the Vector implementation? Can you tell whether the two implementations will yield the same behavior in this regard?

What does that imply about the ADT specification? I mean, I've been claiming that changing implementations shouldn't affect the client, but it seems like in this case the change of implementation might change the behavior. Is that a problem?

Please answer this question in 2-3 thoughtful paragraphs, and include them with your solutions.



Allen B. Downey
1998-09-29