Guest User

Untitled

a guest
Dec 12th, 2015
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. #include <string>
  2. #include <fstream>
  3. #include <cstring>
  4.  
  5. using namespace std;
  6.  
  7. typedef string TreeType;
  8.  
  9. struct Node
  10. {
  11. Node * left;
  12. TreeType word;
  13. int count;
  14. Node * right;
  15. };
  16.  
  17. class BST
  18. {
  19. public:
  20. BST();
  21. ~BST();
  22. bool Empty();
  23. bool Insert(TreeType);
  24. void Delete(TreeType);
  25. void write();
  26. void InOrder(Node*);
  27. void PostOrderDelete(Node*, Node*, TreeType);
  28. ofstream OutputFile;
  29. int findMax();
  30. int total(Node*);
  31. int NodeTotal();
  32. /*void PostOrder(Node*, string);
  33. void PreOrder(Node*, string);*/
  34. private:
  35. int NodeTotalRecursive(Node*);
  36. int height(Node*);
  37. int max(int, int);
  38. void DeleteAll(Node*);
  39. void Process(Node*);
  40. Node* Root;
  41. };
Advertisement
Add Comment
Please, Sign In to add comment