public interface Queue<E>
Modifier and Type | Method and Description |
---|---|
E |
dequeue()
Removes and returns the first element of the queue.
|
void |
enqueue(E e)
Inserts an element at the rear of the queue.
|
E |
first()
Returns, but does not remove, the first element of the queue.
|
boolean |
isEmpty()
Tests whether the queue is empty.
|
int |
size()
Returns the number of elements in the queue.
|
int size()
boolean isEmpty()
void enqueue(E e)
e
- the element to be insertedE first()
E dequeue()