Package com.zybooks.dsaj.stackqueue
Interface CircularQueue<E>
- Type Parameters:
E
- the element type
- All Superinterfaces:
Queue<E>
- All Known Implementing Classes:
LinkedCircularQueue
This provides one additional method not part of the general Queue interface.
A call to Q.rotate() is logically equivalent to the combination
Q.enqueue(Q.dequeue()), yet may be implemented more efficiently in some realizations.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
rotate()
Rotates the front element of the queue to the back of the queue.
-
Method Details
-
rotate
void rotate()Rotates the front element of the queue to the back of the queue. This does nothing if the queue is empty.
-