public class IntQueue2 extends Object
An IntQueue can be described as [n1, n2, ..., n_k], where n1 is the least-recently-added item in the queue and is the next item to be removed. n_k is the most-recently-added and will be the last of the current elements to be removed.
An IntQueue can also be described constructively, with the append operation, ':', such that [n1, n2, ..., n_k] : n_k+1 is the result of enqueing n_k+1 at the end of the queue.
Constructor and Description |
---|
IntQueue2() |
public IntQueue2()
public void enqueue(Integer entry)
entry
- item to be added to the queuepublic Integer dequeue()
public Integer front()
public int size()
public boolean isEmpty()
public void checkRep()