Unformatted text preview: * @return reference to top element */ const std::string& top() const; /** Inserts an object at the top of the stack. If the stack * is already at capacity, the oldest element will be lost. * @param the new element */ void push(const std::string& elem); /** Removes the top object from the stack. * Throws a runtime_error if the stack is empty. */ void pop(); private: const int front=0; int back=0; int capacity; Object* Queue; // Feel free to add whatever additional data or functions that you wish. }; #endif...
View Full Document
This note was uploaded on 05/03/2011 for the course CSCI 180 taught by Professor Goldwasser,m during the Fall '08 term at Saint Louis.
- Fall '08
- Data Structures