Next: Sort those Golfers
Up: Assignment 7: Priority Queue
Previous: Assignment 7: Priority Queue
- Write an implementation of a Priority Queue using
a linked list. The items in the list should be sorted so
that the one at the head of the list has the highest priority.
There are three ways you might proceed:
- A Priority Queue might contain a List object as an
instance variable.
- A Priority Queue might contain a reference to the
first Node object in a linked list.
- A Priority Queue might extend (inherit from) the existing
List class.
Think about the pros and cons of each and choose one.
Allen Downey
Thu Oct 26 10:33:01 EDT 2000