@Override public E pop() { if (isEmpty()) throw new RuntimeException("Stack is already empty"); Node<E> node = ll.head(); E item = node.getKey(); ll.delete(node); return item; }
@Override public String toString() { return ll.toString(); }
@Override public void push(E item) { ll.insert(item); }
@Override public boolean isEmpty() { return ll.head() == null; }