public class Queue
extends java.lang.Object
but improved to hold k elements in an array of length k, not k-1.
Modifier and Type | Field and Description |
---|---|
protected java.lang.Object[] |
array |
protected int |
back |
protected boolean |
extendable |
protected int |
front |
static int |
INITIAL_SIZE |
protected int |
size |
Constructor and Description |
---|
Queue() |
Queue(int initialSize) |
Queue(int initialSize,
boolean extendable) |
Modifier and Type | Method and Description |
---|---|
void |
clear() |
java.lang.Object |
dequeue() |
void |
enqueue(java.lang.Object e) |
java.util.Iterator |
iterator() |
int |
size() |
java.lang.String |
toString() |
protected java.lang.Object[] array
protected int front
protected int back
protected int size
public static final int INITIAL_SIZE
protected boolean extendable