#ifndef STACKWITHLINKEDLIST_H #define STACKWITHLINKEDLIST_H #include "LinkedList.h" template class Stack { public: Stack(); bool isEmpty() const; T peek() const throw (runtime_error); void push(T value); T pop(); int getSize() const; private: LinkedList list; }; template Stack::Stack() { } template bool Stack::isEmpty() const { return list.isEmpty(); } template T Stack::peek() const throw (runtime_error) { return list.getLast(); } template void Stack::push(T value) { list.addLast(value); } template T Stack::pop() throw (runtime_error) { return list.removeLast(); } template int Stack::getSize() const { return list.getSize(); } #endif