树  0.1
数据结构_第6章
Stack.h
Go to the documentation of this file.
1 /****************************************************
2  * @file Stack.h
3  * @author Guorui Wei (313017602@qq.com)
4  * @brief 栈的抽象类
5  * @version 0.1
6  * @date 2020-04-05
7  *
8  * @copyright Copyright (c) 2020
9  *
10  * See the file LICENSE in the top directory of this distribution for
11  * more information.
12  *
13  ****************************************************/
14 
15 #ifndef INCLUDE_STACK_H_
16 #define INCLUDE_STACK_H_
17 
18 #include <initializer_list>
19 #include <utility>
20 
21 namespace Stack
22 {
23 
24 template <class T>
25 class Stack
26 {
27 public:
28  virtual bool isEmpty() const = 0; // 判栈空
29  virtual void push(const T &elem) = 0; // 进栈
30  virtual T pop() = 0; // 出栈
31  virtual T top() const = 0; // 读栈顶元素
32  virtual ~Stack() = default;
33 };
34 
35 } // namespace Stack
36 
37 #include "linkStack.hpp"
38 #include "seqStack.hxx"
39 
40 #endif /* INCLUDE_STACK_H_ */
linkStack.hpp
seqStack.hxx
Stack
Definition: linkStack.hpp:20