Skip to content

Commit e6270da

Browse files
committed
Create my_binary_tree.h
1 parent 053b754 commit e6270da

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#ifndef MY_BINARY_TREE_H
2+
#define MY_BINARY_TREE_H
3+
4+
#include <iostream>
5+
6+
//MBT stand for My Binary Tree
7+
namespace MBT
8+
{
9+
//二叉树抽象类
10+
template <typename anytype>
11+
class MyBinaryTree
12+
{
13+
public:
14+
virtual ~MyBinaryTree(){};
15+
virtual bool empty() const = 0 ;
16+
virtual int size() const = 0;
17+
virtual void preOrder(void(*)(anytype *)) = 0;
18+
virtual void inOrder(void(*)(anytype *)) = 0;
19+
virtual void postOrder(void(*)(anytype *)) = 0;
20+
virtual void levelOrder(void(*)(anytype *)) = 0;
21+
};
22+
}
23+
24+
#endif //my_binary_tree.h

0 commit comments

Comments
 (0)