辅助类BinaryTreeNode
(二叉树节点)
template<typename T>
class BinaryTreeNode
{
public:
T key;
BinaryTreeNode<T>* parent;
BinaryTreeNode<T>* left;
BinaryTreeNode<T>* right;
public:
BinaryTreeNode(){}
BinaryTreeNode(T key,BinaryTreeNode<T>* parent = nullptr,BinaryTreeNode<T>* left = nullptr,BinaryTreeNode<T>* right = nullptr):key(key),parent(parent),left(left),right(right){}
};