/***************************************** * Instructions * - Replace 'uwuserid' with your uWaterloo User ID * - Select the current calendar term and enter the year * - List students with whom you had discussions and who helped you * * uWaterloo User ID: uwuserid @uwaterloo.ca * Submitted for ECE 250 * Department of Electrical and Computer Engineering * University of Waterloo * Calender Term of Submission: (Winter|Spring|Fall) 201N * * By submitting this file, I affirm that * I am the author of all modifications to * the provided code. * * The following is a list of uWaterloo User IDs of those students * I had discussions with in preparing this project: * - * * The following is a list of uWaterloo User IDs of those students * who helped me with this project (describe their help; e.g., debugging): * - *****************************************/ #ifndef TRIE_H #define TRIE_H #ifndef nullptr #define nullptr 0 #endif #include "ece250.h" #include "Trie_node.h" #include "Exception.h" #include #include #include class Trie { private: Trie_node *root_node; int trie_size; public: Trie(); ~Trie(); // Accessors int size() const; bool empty() const; bool member( std::string const & ) const; Trie_node *root() const; // Mutators bool insert( std::string const & ); bool erase( std::string const & ); void clear(); // Friends friend std::ostream &operator<<( std::ostream &, Trie const & ); }; Trie::Trie(): root_node( nullptr ), trie_size( 0 ) { // empty constructor } Trie::~Trie() { } int Trie::size() const { return 0; } bool Trie::empty() const { return false; } Trie_node *Trie::root() const { return nullptr; } bool Trie::member( std::string const &str ) const { return false; } bool Trie::insert( std::string const &str ) { return false; } bool Trie::erase( std::string const &str ) { return false; } void Trie::clear() { } // You can modify this function however you want: it will not be tested std::ostream &operator<<( std::ostream &out, Trie const &trie ) { /* for ( Trie_node *ptr = trie.head(); ptr != nullptr; ptr = ptr->next() ) { out << "->" << ptr->value(); } */ out << "->0"; return out; } // Is an error showing up in ece250.h or elsewhere? // Did you forget a closing '}' ? #endif