CS215stack(5o5)

CS215stack(5o5) - full. // POST: newItem is at the top of...

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

View Full Document Right Arrow Icon
Sheet1 #ifndef CS215STACK #define CS215STACK #include "nodetype.h" #include <iostream> class CS215stack { public: CS215stack( ) // Default constructor. // POST: Stack is created and empty. bool IsEmpty( ) const // PRE: Stack has been initialized. // POST: Function value = true if(stack is empty) bool IsFull( ) const // PRE: Stack has been initialized. // POST: Function value = true if (stack is full) void Push( int newItem ) // PRE: Stack has been initialized and is not
Background image of page 1

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

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

Unformatted text preview: full. // POST: newItem is at the top of the // stack. void Pop( int& item ) // PRE: Stack has been initialized and is not empty. // POST: top element has been removed from // stack.item is a copy of removed element. v void MakeEmpty( ) ~CS215stack( ) // PRE: Stack has been initialized. // POST: Memory allocated for nodes has been / // deallocated. p private: NodeType* topPtr // NULL if stack empty } #endif // Pointer to top of stack // destructor Page 1...
View Full Document

This note was uploaded on 10/13/2008 for the course CS 215 taught by Professor Piwowarski during the Spring '06 term at Kentucky.

Page1 / 2

CS215stack(5o5) - full. // POST: newItem is at the top of...

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