We're going to work through the methods that define a queue in
lab. The queue should implement the functions listed under the Queue
interface in the java documentation, but it does not need to implement
We're not implementing the Queue
You can use your existing linked list implementation (single or double) to implement the Queue interface.
Documentation for Java 1.6 is located at: Java 1.6 SE API
- Find the Queue interface documentation and see what the key functions are. What is the difference between them?
- Implement the six interface functions. The add and offer methods should put the new node on the end of the queue, and the remove and poll methods should remove and return the data in the node at the head of the queue.
- Make sure your iterator loops over the linked list from the head to the tail of the queue.
For more details, see this week's assignment.