栈  0.1
数据结构_第3章
Stack.hh
Go to the documentation of this file.
1 
12 #ifndef __StackIncluded
13 #define __StackIncluded
14 
15 #include <initializer_list>
16 #include <utility>
17 
18 namespace Stack
19 {
20 
21 template <class T>
22 class Stack
23 {
24 public:
25  virtual bool isEmpty() const = 0; // 判栈空
26  virtual void push(const T &elem) = 0; // 进栈
27  virtual T pop() = 0; // 出栈
28  virtual T top() const = 0; // 读栈顶元素
29  virtual ~Stack() = default;
30 };
31 
32 } // namespace Stack
33 
34 #include "linkStack.hpp"
35 #include "seqStack.hxx"
36 
37 #endif
linkStack.hpp
顺序栈类
seqStack.hxx
Stack
Definition: linkStack.hpp:17