| Constructor and Description |
|---|
ArrayQueue()
Default construct
Creates a new queue of capacity 100
|
ArrayQueue(int capacity)
Creates a new queue of a given capacity
|
| Modifier and Type | Method and Description |
|---|---|
E |
dequeue()
Removes the element at the front of the queue.
|
void |
enqueue(E element)
Inserts an element at the rear of the queue.
|
E |
front()
Inspects the element at the front of the queue.
|
boolean |
isEmpty()
Returns whether the queue is empty.
|
int |
size()
Returns the size of the queue
|
java.lang.String |
toString() |
public ArrayQueue()
public ArrayQueue(int capacity)
capacity - public int size()
public boolean isEmpty()
Queuepublic E front()
Queuepublic void enqueue(E element)
Queuepublic E dequeue()
Queuepublic java.lang.String toString()
toString in class java.lang.Object