23 lines
526 B
C++
23 lines
526 B
C++
//
|
|
// Created by PC on 25-8-6.
|
|
//
|
|
|
|
#ifndef BINARYTREENODE_H
|
|
#define BINARYTREENODE_H
|
|
|
|
template<class T>
|
|
class binaryTreeNode {
|
|
public:
|
|
T element;
|
|
binaryTreeNode<T>* left;
|
|
binaryTreeNode<T>* right;
|
|
public:
|
|
binaryTreeNode() {left = right = nullptr;}
|
|
explicit binaryTreeNode(const T& e) : element(e), left(nullptr), right(nullptr) {}
|
|
binaryTreeNode(const T& e, binaryTreeNode<T>* l, binaryTreeNode<T>* r) : element(e), left(l), right(r) {}
|
|
~binaryTreeNode() = default;
|
|
|
|
};
|
|
|
|
#endif //BINARYTREENODE_H
|