package asd_library.stack;

/**
 * The abstract data type stack.
 */

public interface Stack_adt {

  /**
   * Stores an item on the stack.
   * @param el the object to store.
   */
  void push(Object el);


  /**
   * Retrieves an item and deletes it from the stack.
   * @return the object deleted from the stack.
   */
  Object pop();

  /**
   * Retrieves the item from the stack head but doesn't remove it.
   * @return the object on the top of the stack.
   */
  Object top();

  /**
   * Verifies if the stack is empty.
   * @return true if the stack is empty, false otherwise.
   */
  boolean isEmpty();
}



 


Bacheca di Algoritmi e Strutture Dati a.a. 2007-08 - canale A - L

forum del corso

ultima modifica: 03/04/2008 23.35
by FdA