Files
912-notes/thu_dsa/chp4/Stack.h
2019-05-20 09:36:58 +08:00

16 lines
281 B
C++

#ifndef STACK_H_
#define STACK_H_
#include "../chp2/Vector.h"
template <typename T>
class Stack: public Vector<T>{
public:
//stack basic operations
void push(T const &e) { push_back(e); }
T pop() { return pop_back(); }
T& top() { return get(getSize() - 1); }
};
#endif