Question: This program must be done in a Linux or Unix environment, using a command line compiler like g++. Do not use codeblocks, eclipse, or Xcode

 This program must be done in a Linux or Unix environment,

using a command line compiler like g++. Do not use codeblocks, eclipse,

This program must be done in a Linux or Unix environment, using a command line compiler like g++. Do not use codeblocks, eclipse, or Xcode to compile.

Problem: Implement an interface that manipulates a list of strings. You will be provided with the following files on the Tracs .StringList.h containing a class declaration, set up for a linked list representation. Driver.cpp containing a main function you can use to test your implementation You will be responsible for providing the StringList.cpp file, including the implementation of the StringList member functions (described below): StringList and StringList: creates an empty list, and deallocates all the nodes in the list, respectively count: returns the total number of strings (nodes) in the list. Any duplicate strings should be counted. add(string) Adds a new node containing the string to either the beginning OR the end of the list (your choice, pick one, use the same one every time) remove(string) removes a node containing the given string from the linked list. Returns true if successful, otherwise false (if the string was not in the list) display): displays the strings in the list to the screen, one string per line. minimum(): returns the string that would come first in alphabetical (ascii) ordering. Does not change the list! sort): Here is the algorithm you must use for implementing the sort function 1. Define a StringNode* to be the head of a new list (make it the empty list). This should be a local variable (not a class member) 2. Repeat until the original list is empty: a. Find the minimum string in the original list and remove that node from the original list. Call functions you have already defined to do this. b. Insert this node into the proper position in the new list (at the end) 3. make the old head pointer (now empty) point to the new list! Input/Output: Problem: Implement an interface that manipulates a list of strings. You will be provided with the following files on the Tracs .StringList.h containing a class declaration, set up for a linked list representation. Driver.cpp containing a main function you can use to test your implementation You will be responsible for providing the StringList.cpp file, including the implementation of the StringList member functions (described below): StringList and StringList: creates an empty list, and deallocates all the nodes in the list, respectively count: returns the total number of strings (nodes) in the list. Any duplicate strings should be counted. add(string) Adds a new node containing the string to either the beginning OR the end of the list (your choice, pick one, use the same one every time) remove(string) removes a node containing the given string from the linked list. Returns true if successful, otherwise false (if the string was not in the list) display): displays the strings in the list to the screen, one string per line. minimum(): returns the string that would come first in alphabetical (ascii) ordering. Does not change the list! sort): Here is the algorithm you must use for implementing the sort function 1. Define a StringNode* to be the head of a new list (make it the empty list). This should be a local variable (not a class member) 2. Repeat until the original list is empty: a. Find the minimum string in the original list and remove that node from the original list. Call functions you have already defined to do this. b. Insert this node into the proper position in the new list (at the end) 3. make the old head pointer (now empty) point to the new list! Input/Output

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!