We're going to work through how to write a queue in lab. The queue should implement the functions listed under the Queue interface in the java documentation. We won't worry about the more general Collection interface functions.
Documentation for Java 1.5 is located at: Java 1.5 SE API.
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.
- Implement the queue as a singly-linked list.
- Implement an iterator for the queue so it can implement the Iterable interface.
- Implement a method public int position(Object obj) that returns the position of the given Object in the queue.
For more details, see this week's assignment.