#ifndef TREEMAP_H #define TREEMAP_H #include #include using namespace std; class TreeMap { public: // Empty TreeMap(); // Copy the contents of that other one TreeMap(const TreeMap& other); // Free up the memory ~TreeMap(); // Return a reference the value stored under the given key (if any) // If there IS NOT a node with that key, create a new one and return // a reference to the empty string contained in the new node. string& operator [] (const string& key); // Assignment operator TreeMap& operator = (const TreeMap& other); // Remove the given value void remove(const string& toRemove); // Does this value exist? bool has_key(const string& toFind) const; // How many keys do we have? unsigned int size() const; private: // This will be what is stored in each Node of the tree struct Node { // This is the key: the word we are looking up (in the dictionary // example.) This is what we will do our binary-search ordering // on. string key; // This is the value that is "mapped to" by the key string val; // This makes it a binary tree Node* left; Node* right; }; // TODO // You'll need to add other stuff here }; #endif // TREEMAP_H