//myq6.h === queue using deque -- by tsaiwn@csie.nctu #include using namespace std; template class MyStack: deque { public: void push(const T& y) { MyStack::push_back(y); } T top( ) { return MyStack::front( ); } void pop( ) { MyStack::pop_front( ); } bool empty( ) { return MyStack::begin() == MyStack::end(); } };