Question: Text is readable just zoom in on browser. Thanks some word games require rearranging a combination of letters to make a word. This type of

Text is readable just zoom in on browser. Thanks

Text is readable just zoom in on browser. Thanks some word games

require rearranging a combination of letters to make a word. This type

some word games require rearranging a combination of letters to make a word. This type of arrangement is generally referred to as an anagram, it's known as a permutation in mathematics.This assignment will give you some experience thinking about and writing recursive functions. Write a C++ program that searches for anagrams" in a dictionary. An anagram is a word obtained by scrambling the letters of some string. For example, the word pot" is an anagram of the stringotp. A sample run of the program is given below. Your output does not have to be formatted exactly the same as that shown in the sample, but should be in a similar style You can use words.txt as your dictionary file and anagram.cpo as an example of a main program. Since the purpose of this assignment is to give you experience using recursion, you may not use any of C+'teration constructs (do, while, for, and goto) or any STL algorithms (if you have no idea was this means, you're OK). All repetition must be accomplished using recursion. This applies to every operation in the program, even file operations. Obviously, you would never write a program like this in industry but as an exercise it should be useful to gain experience with recursion. Sample Runs Here are two examples of how the program might work: Please enter a string for an anagram: opt Matching word opt Matching word pot Matching word top Please enter a string for an anagram: blah No matches found IOASOTISTOTOSTSOTNIININONNRONOTOTONNNM llanagram.cpp #include include #include #include using namespace std; const int MARESULTS -20; // Max matches that can be found const int MAXDICTWORDS 30000; I/Max words that can be read in int main() string results[MAXRESULTSI: string dict(MAXDICTWORDS] ifstream dictfile; file containing the list of words int nwords; string word; I/ number of words read from dictionary dictfile.open"words.txt if (dictfile) cout > word; int numMatches recursivePermute(word, dict, nwords, results) if (InumMatches) cout

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!