/* WordList source file * * *   This file will contain the function definitions you will implement. *   The function...

70.2K

Verified Solution

Question

Programming

/* WordList source file
*
*
*   This file will contain the function definitions youwill implement.
*   The function signitures may NOT be changed. You maycreate your own
*   helper functions and include them in this file.
*
*   In addition to the specific instructions for eachfunction, no function
*   should cause any memory leaks or alias m_list in anyway that would result
*   in undefined behavior.
*
*   Topics: Multilevel Pointers, Dynamic Allocation,Classes
*
*/

private:
#endif

   unsigned int m_count;   // Number ofwords currently in list
   unsigned int m_max;       //The total size of the list.
   char** m_list;   // The list storing thewords

};

/* Function: Wordlist Constructor
*/
WordList::WordList(const int max_words) {

   m_count = 0;
   if (max_words > 0) {
       m_max = max_words;
       m_list = new char*[max_words];
   }
}

/* Function: Wordlist Copy Constructor
*/
WordList::WordList(const WordList& other) {

   m_count = other.m_count;
   m_max = other.m_max;
   m_list = new char* [m_max];
   for (int i = 0; i < m_max; i++) {
       m_list[i] = other.m_list[i];
   }

}
/* Function: Wordlist Destructor
*/
WordList::~WordList() {

   delete []m_list;

}

/* Function: printList
*/
int   WordList::print() const {   //TODO:
   return -1;

}

/* Function: at
*/
char* WordList::at(const int index) const {   //TODO:
   return nullptr;

}
/* Function: count
*/
int   WordList::count() const { // TODO:
   return -1;

}
/* Function: add
*/
int   WordList::add(const char word[]) { // TODO
   return -2;

}
/* Funtion: remove
*/
int   WordList::remove(const char word[]) { //TODO:
   return -1;
}

/* Funtion: append
*/
int   WordList::append(const WordList* other) { //TODO:
   return -2;

}
/* Funtion: search
*/
int WordList::search(const char word[]) const {   //TODO:
   return -1;

}
/* Funtion: sort
*/
int   WordList::sort() {   // TODO:
return -1;

}
/* Funtion: Assignment Operator
*/
WordList& WordList::operator=(const WordList& other) { //TODO:
   return *this;
}

Answer & Explanation Solved by verified expert
4.1 Ratings (759 Votes)
include using namespace std const int E 001 const int MAXITER 100 class Wordlist    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students