This commit is contained in:
e2hang
2025-08-09 19:23:37 +08:00
parent ac48a86396
commit 17105e9e9e
13 changed files with 194 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
//
// Created by PC on 25-8-6.
//
#ifndef BINARYTREE_H
#define BINARYTREE_H
#include "binaryTreeNode.h"
template <class T>
class binaryTree {
public:
virtual ~binaryTree() = default;
virtual bool empty() const = 0;
virtual int size() const = 0;
virtual void preOrder(void(*) (binaryTreeNode<T>*) ) const = 0;
virtual void inOrder(void(*) (binaryTreeNode<T>*) ) const = 0;
virtual void postOrder(void(*) (binaryTreeNode<T>*) ) const = 0;
virtual void levelOrder(void(*) (binaryTreeNode<T>*) ) const = 0;
};
#endif //BINARYTREE_H