In this project you will write code for Dequeue data structure. Dequeue is a special kind of a Queue where additions and deletions can be done at both ends. You are to implement Dequeue using a circular array. Dequeue has instance variables front, rear and elements (the array that holds the elements of the Dequeue). Go over the circular array implementation of Queue code is posted in Blackboard.
Recall that, for an empty Queue rear is one-position counter clockwise to front and unfortunately, the same configuration holds for a full queue. To distinguish between a full-queue and an empty queue, we kept track of the number of elements in count instance variable. (if count == 0, the queue is empty, and if count == elements.length, queue is full).
In our implementation of Dequeue, there is no count variable to keep track of the number of elements. Instead, to distinguish a full-queue from an empty queue, we never allow the queue to get completely full. A full queue is one with exactly one empty spot in the array. That way we can distinguish an empty queue and full queue by looking at the relative positions of front and rear.
You are given Dequeue.html which outlines the behavior of each method in Dequeue:
You are to write a Junit test suite to test all the methods including the iterator for Dequeue.
Draw pictures to understand the concepts.