This repository has been archived on 2021-06-15. You can view files and clone it, but cannot push or open issues or pull requests.
CS2-projects/Lab108-VenbergGE/src/PrevAssignmentClasses/Queue.java
2021-03-31 11:55:52 -05:00

29 lines
656 B
Java

/**
* Data Structures & Algorithms 6th Edition
* Goodrich, Tamassia, Goldwasser
* Code Fragment 6.9
*
* An implementation of the Queue interface
* */
/**
*
* @author Gabriel Venberg
*/
public interface Queue<E> {
/** returns the number of elements in the queue*/
int size();
/** tests whether the queue is empty*/
boolean isEmpty();
/**inserts an element at the rear of the queue*/
void enqueue(E e);
/**returns, but does not remove, the first element of the queue (null if empty). */
E first();
/** removes and returns the first element of the queue (null if empty)*/
E dequeue();
}