Interface CircularQueue<E>

Type Parameters:
E - the element type
All Superinterfaces:
Queue<E>
All Known Implementing Classes:
LinkedCircularQueue

public interface CircularQueue<E> extends Queue<E>
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 Type
    Method
    Description
    void
    Rotates the front element of the queue to the back of the queue.

    Methods inherited from interface com.zybooks.dsaj.stackqueue.Queue

    dequeue, enqueue, first, isEmpty, size
  • 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.