AlteredTree

This commit is contained in:
e2hang
2025-08-12 12:09:53 +08:00
parent ba9ceaab14
commit a2e3b28ac0
8 changed files with 350 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
//
// Created by PC on 25-8-11.
//
#ifndef BINARYTREENODE_H
#define BINARYTREENODE_H
#include <utility>
template<class K, class E>
class binaryTreeNode {
public:
std::pair<K, E> element;
binaryTreeNode<K, E>* left;
binaryTreeNode<K, E>* right;
binaryTreeNode() : left(nullptr), right(nullptr){}
explicit binaryTreeNode(const std::pair<K, E>& e) : element(e), left(nullptr), right(nullptr) {}
binaryTreeNode(const std::pair<K, E>& e, binaryTreeNode<K, E>* l, binaryTreeNode<K, E>* r) : element(e), left(l), right(r) {}
};
#endif //BINARYTREENODE_H