BinaryTree

This commit is contained in:
e2hang
2025-08-06 16:22:28 +08:00
parent 07f34fe0bb
commit 5bdb044421
6 changed files with 225 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