CS200 Lab 2—Implementing Queues

Overview

In this lab you will implement several Queues.

Files

Put these files in an Eclipse project:

Part 1: Queue

The Stack is from the example code from the first week’s lectures. You need to implement the Queue, according to its interface. The instance variables, constructor, and main method have been provided. Queue.java does not compile. What do you need to do to make Queue.java work?

Do not implement your own linked list. Use the methods of the LinkedList type. If you find yourself allocating nodes and setting references, then you’re doing it wrong.

Part 2: Circular Queue

Take the code in CQueue.java and create a circular queue.