public class LinkedQueue<E> extends Object implements Queue<E>
SinglyLinkedList
Constructor and Description |
---|
LinkedQueue()
Constructs an initially empty queue.
|
Modifier and Type | Method and Description |
---|---|
E |
dequeue()
Removes and returns the first element of the queue.
|
void |
enqueue(E element)
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.
|
String |
toString()
Produces a string representation of the contents of the queue.
|
public int size()
public boolean isEmpty()
public void enqueue(E element)
public E first()
public E dequeue()