good evening I was wondering if someone could walk me through creating a find and insert functions for the following class
//map of characters
//class to create a map of words, character at a time and allow access to each character and store a list of lines
//from the input which the word is stored
class IndexClass
{
public:
IndexClass() {};
void insert(const string word, const int page);
vector<int> findPages(const string word);
private:
vector<int> pages; // list of pages
map <char, IndexClass *> next; // pointer to next letter
list <IndexClass> indexList;
};
I can add functionality to the class but not get rid of anything sadly. I have been wracking my brain for 4 days straight now but I can't come to think of how to link the different instances of indexclass to access the map for each and keep track of them/move around them. sadly I don't understand pointers well enough it seems and cannot seem to find any examples on google which answer my troubles.
but essentially I need to insert word which have been formatted to lower case with no punctuation into a series of maps each with a key of the characters in the word one at a time with the data being a pointer to another instance of indexclass. and finally at the last node amend pages but adding the page the word is on. and somehow check to see if the word has been entered before. any tips or tutorials you could link to would be GREATLY appreciated.