Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <fstream>
- using namespace std;
- class BinaryTree
- {
- public:
- BinaryTree();
- ~BinaryTree();
- void Insert(int x);
- void InOrder();
- bool Search(int x);
- void treeToFile(ofstream& file);
- private:
- struct node
- {
- int key;
- node* left;
- node* right;
- };
- node* root;
- void Clear(node* nod);
- void Insert(int x, node*& nod);
- void InOrder(node* nod);
- bool Search(int x, node* nod);
- void treeToFile(node* nod, ofstream& file);
- };
Add Comment
Please, Sign In to add comment