Method Listing


Specific:


Common:


ADT Spec (Method Descriptions)


Also see super-ADT SpecializedStructureIdea....


/**
 * ADT: StackIdea
 * Description: The idea for a Stack structure
 * Notes:
 * 	1) Also see super-ADT (parent ADT)
 * 	2) The (inherited) "add" method should do a "push"
 * 	3) The (inherited) "toNativeList" should return a list of elements in top to
 * 			bottom order (i.e., the order elements would be "popped")
 */

//Super (Parent) ADT: SpecializedStructureIdea (all methods in super are inherited by StackIdea)
 
ADT: StackIdea {
	
	/**
	 * Pushes (adds) element onto top of stack
	*/
	push(newElem)
	

	/**
	 * Removes element from top of stack
	 * Returns the removed element
	   If list is empty, throws exception:
			"(pop) Attempted to access element in empty list"
	 */
	pop()
	

	/**
	 * Returns element from top of stack
	 * Does NOT remove element
	 * If structure is empty, return null
	 */
	peek()
	
}