public class IntegerArrayBasedQueue
extends java.lang.Object
Constructor and Description |
---|
IntegerArrayBasedQueue(int size)
Initialize a queue (with a given size)
|
Modifier and Type | Method and Description |
---|---|
void |
add(int value)
Add a value at the end of the queue.
|
boolean |
isEmpty()
Check whether the stack is empty
|
int |
poll()
Removes the value at the top of this queue and returns that value as the value of this function.
|
void |
reset()
Reset the array: all elements are removed (set to 0)
|
java.lang.String |
toString()
Returns a string representing the elements stored in the queue
|
public IntegerArrayBasedQueue(int size)
public void add(int value)
public int poll()
public boolean isEmpty()
public void reset()
public java.lang.String toString()
toString
in class java.lang.Object