Guest User

Untitled

a guest
May 5th, 2017
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.46 KB | None | 0 0
  1. #include <fstream>
  2. using namespace std;
  3.  
  4. class BinaryTree
  5. {
  6. public:
  7.     BinaryTree();
  8.     ~BinaryTree();
  9.    
  10.     void Insert(int x);
  11.     void InOrder();
  12.     bool Search(int x);
  13.     void treeToFile(ofstream& file);
  14.  
  15. private:
  16.     struct node
  17.     {  
  18.         int key;
  19.         node* left;
  20.         node* right;
  21.     };
  22.     node* root;
  23.     void Clear(node* nod);
  24.     void Insert(int x, node*& nod);
  25.     void InOrder(node* nod);
  26.     bool Search(int x, node* nod);
  27.     void treeToFile(node* nod, ofstream& file);
  28. };
Add Comment
Please, Sign In to add comment