//A queue is a structure that lets you add and remove such that the first //added is the first one removed. First in, first out, like a line at //Disneyworld. If 'a' is added and then 'b' is added, the next remove must //return 'a'. public class Queue { //The one data member LinkedList list; public Queue() { list = new LinkedList(); } public void enqueue(int n) { list.insert(n); } public int dequeue() { int res = list.getVal(list.length() - 1); list.remove(list.length()-1); return res; } public int peek() { return list.getVal(list.length() - 1); } public int size() { return list.length(); } }