Advertisement
Guest User

Untitled

a guest
Apr 25th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. #ifndef PROJECT10_TREE_H
  2. #define PROJECT10_TREE_H
  3.  
  4. #include <iostream>
  5.  
  6. #include <vector>
  7.  
  8. using namespace std;
  9.  
  10. class Tree {
  11.  
  12. private:
  13.  
  14. typedef struct Node {
  15.  
  16. vector <char> word;
  17. int count = 0;
  18.  
  19. Node* left;
  20. Node* right;
  21.  
  22. }*nPtr;
  23.  
  24. nPtr root;
  25.  
  26. int length (nPtr p);
  27.  
  28. void insert(nPtr& p, vector <char> input);
  29.  
  30. void remove(nPtr& p, vector <char> target);
  31.  
  32. void remove (nPtr& p);
  33.  
  34. public:
  35.  
  36. Tree(){ root = NULL; }
  37.  
  38. bool empty(){ return root == NULL; }
  39.  
  40. int length(){ return length(root); }
  41.  
  42. bool present(vector <char> target);
  43.  
  44. void insert(vector <char> entry){ insert(root, entry); }
  45.  
  46. void remove(vector <char> target){ remove(root, target); }
  47.  
  48. };
  49.  
  50. int operator < (vector <char> a, vector <char> b);
  51.  
  52.  
  53. #endif //PROJECT10_TREE_H
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement