public class Stack<T extends Comparable <T>>
{
  LL<T> theStack;

  public Stack()
  {
    this.theStack = new LL<T>();
  }

   public boolean isEmpty()
   {
     return this.theStack.isEmpty();
   }

  public boolean isFull()
  {
    return false;
  }

  public T pop() throws LLException
  {
    return this.theStack.removeFromHead();
  }

  public void push(T value)
  {
    this.theStack.insertAtHead(value);
  }

  public T peek() throws LLException
  {
    T temp = this.theStack.removeFromHead();
    this.theStack.insertAtHead(temp);
    return temp;
  }

  public String toString()
  {
    return this.theStack.toString();
  }
}
