// // Created by yinus on 2016/4/2. // #ifndef DS_AA_STACK_H #define DS_AA_STACK_H #include "List.h" template <typename Object> class Stack { public: Stack():list() { } ~Stack(){} bool empty() const{ return list.empty(); } void clear(){ list.clear(); } int size() const{ return list.size(); } Object top() const{ return list.back(); } void push(const Object& x){ list.push_back(x); } void pop(){ list.pop_back(); } private: List<Object> list; }; #endif //DS_AA_STACK_H