package traverse; public class LQueue implements Queue { public SLNode front, back; public void add(T obj) { SLNode temp = new SLNode(obj); if(isEmpty()) front = back = temp; else { back.next = temp; back = temp; } } public T remove() throws EmptyStructure { if(isEmpty()) throw new EmptyStructure(); else { T temp = front.item; front = front.next; if(front==null) back = null; return(temp); } } public boolean isEmpty() { return front==null; } }