StackLi - package DataStructures; / / / / / / / / / / / / /...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
package DataStructures; // StackLi class // // CONSTRUCTION: with no initializer // // ******************PUBLIC OPERATIONS********************* // void push( x ) --> Insert x // void pop( ) --> Remove most recently inserted item // Object top( ) --> Return most recently inserted item // Object topAndPop( ) --> Return and remove most recent item // boolean isEmpty( ) --> Return true if empty; else false // boolean isFull( ) --> Always returns false // void makeEmpty( ) --> Remove all items // ******************ERRORS******************************** // pop on empty stack /** * List-based implementation of the stack. * @author Mark Allen Weiss */ public class StackLi { /** * Construct the stack. */ public StackLi( ) { topOfStack = null; } /** * Test if the stack is logically full. * @return false always, in this implementation. */ public boolean isFull( ) { return false; } /** * Test if the stack is logically empty. * @return true if empty, false otherwise.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 2

StackLi - package DataStructures; / / / / / / / / / / / / /...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online