Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef MYTREE_TREE_H
- #define MYTREE_TREE_H
- struct Node
- {
- Node* right = nullptr;
- Node* left = nullptr;
- int value;
- };
- #include <iostream>
- class Tree
- {
- private:
- Node* head;
- void preOrder(Node* node);
- void inOrder(Node* node);
- void postOrder(Node* node);
- void addMethod(Node*& node, const int& value);
- void deleteMethod(Node* node);
- void eraseMethod(const int& value);
- int heightMethod(Node* node);
- void func();
- public:
- Tree();
- ~Tree()
- {
- deleteMethod(head);
- };
- bool empty();
- void clear();
- int height();
- void add(const int& value);
- void print(const size_t& sortId);
- };
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement