Advertisement
tikimyster

stree.h

May 8th, 2012
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.61 KB | None | 0 0
  1. #ifndef stree_h
  2. #define stree_h
  3. #include <string>
  4.  
  5. class tree
  6. {
  7.   public:
  8.     tree();
  9.     ~tree();
  10.     void print();
  11.     bool lookup();
  12.     bool insert(std::string value);
  13.     bool remove(std::string target);    
  14.   private:
  15.     class Node
  16.     {
  17.       Node(std::string mString){mString = value; mLeft = NULL, mRight = NULL, mParrent = NULL;}
  18.       std::string value;
  19.       Node *mLeft;
  20.       Node *mRight;
  21.       Node *mParrent;
  22.       ~Node(){delete mLeft; delete mRight;}
  23.     };
  24.     Node *mRoot;
  25.     //bool lookup(string target, Node *root);
  26.     bool insert(std::string value, Node *root);
  27. };
  28.  
  29. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement