Stack - void Pop() { container.RemoveFirst(); } const...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
/*************** THE STACK CLASS ***************/ #ifndef __STACK__ #define __STACK__ #include "SList.h" template <class T> class Stack { public: bool IsEmpty() const { return container.IsEmpty(); } void Push(const T& item) { container.AddFirst(item); }
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: void Pop() { container.RemoveFirst(); } const T& Top() const { return container.ShowFirst(); } private: SList<t> container; }; #endif...
View Full Document

This note was uploaded on 04/07/2008 for the course CS 181 taught by Professor Satya during the Fall '08 term at Stevens.

Ask a homework question - tutors are online