BinaryTree
This commit is contained in:
22
LinearList/BinaryTree/binaryTreeNode.h
Normal file
22
LinearList/BinaryTree/binaryTreeNode.h
Normal file
@@ -0,0 +1,22 @@
|
||||
//
|
||||
// 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
|
Reference in New Issue
Block a user