Queue.EmptyQueueException| Constructor and Description |
|---|
MysteryQueueImplementation()
Constructs an empty queue.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Removes all items from the queue.
|
T |
dequeue()
Removes an item from the front of the queue and returns it.
|
void |
enqueue(T item)
Adds the given item to the back of the queue.
|
boolean |
isEmpty()
Returns true if the queue is empty.
|
T |
peek()
Returns the item at the front of the queue, without removing it.
|
public MysteryQueueImplementation()
public void enqueue(T item)
Queuepublic T dequeue()
Queuepublic T peek()
Queuepublic boolean isEmpty()
Queue