| Constructor and Description |
|---|
LQueue()
Default constructor initializes an empty queue.
|
LQueue(int capacity)
This constructor initializes an empty queue and set its capacity.
|
| Modifier and Type | Method and Description |
|---|---|
int |
capacity() |
T |
element()
Peek at the first item at the front end.
|
boolean |
empty() |
boolean |
offer(T item)
Offer the item into this Queue at the rear end.
|
T |
peek()
Peek at the first item at the front end.
|
T |
peekRear() |
T |
poll()
Remove the item at the front end.
|
T |
remove()
Remove the item from the Queue at the front end.
|
int |
size() |
public LQueue()
public LQueue(int capacity)
capacity - is the initial capacity of the internal arraypublic boolean offer(T item)
Queuepublic T remove()
Queuepublic T poll()
Queuepublic T peek()
Queuepublic T peekRear()
public T element()
Queuepublic int size()
public int capacity()