Question: #include #include #include #include using namespace std; const int MAXRESULTS = 20; // Max matches that can be found const int MAXDICTWORDS = 30000; //

#include  #include  #include  #include  using namespace std; const int MAXRESULTS = 20; // Max matches that can be found const int MAXDICTWORDS = 30000; // Max words that can be read in int main() { string results[MAXRESULTS]; string dict[MAXDICTWORDS]; ifstream dictfile; // file containing the list of words int nwords; // number of words read from dictionary string word; dictfile.open("words.txt"); if (!dictfile) { cout << "File not found!" << endl; return (1); } nwords = readDictionary(dictfile, dict); cout << "Please enter a string for an anagram: "; cin >> word; int numMatches = recursivePermute(word, dict, nwords, results); if (!numMatches) cout << "No matches found" << endl; else recurPrint(results, numMatches); } 

Given the above if you can help create a recursion function with its base cases of the function below. Also Please no use of do, while, or for keywords, or any stl algortithms. In c++

int recursivePermute(string word, const string dict[], int size, string results[]);

Places all the permutations of word, which are found in dict into results. Returns the number of matched words found. This number should not be larger than MAXRESULTS since that is the size of the array. The size is the number of words inside the dict array.

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!