Details of this Paper





This is programming in C++ using visual studio. I also have the 3 files but cant attach on here.;The different steps of this project are detailed here, and the skeleton of the program is provided in the attached file named findAnagrams.cpp;1) The very first step is to read a list of words from a file. The file named readWords.cpp contains a function that just does that. You do not need to modify this function and you should use it as is.;2) Then, we need to build a simple data structure in which we keep a word together with what we call its key. The key attached to a given word is simply its letters sorted alphabetically: for instance the key associated with "vergamini" is "aegiimnrv", and the key associated with "letter" is "eelrtt".;This simple data structure is implemented as the following class;class KeyedWord;public;KeyedWord(char* word);char* getWord();char* getKey();private;char* _word;char* _key;The constructor of this class needs to copy its argument into its data member, and needs to compute the key. For that, you can use a selection sort as the one given in figure 8.20 page 359.;3) From the array of words read in step 1, you need to populate an array of KeyedWord structures.;4) Sort the array of KeyedWord structure using their keys, you can also use for this step a selection sort.;5) Since anagrams have the same key, you just need to loop through the sorted array and check if consecutive elements have the same key to print out the anagrams.;Here is a quick example where the initial word list is: "rude", "word", "dure", "from", "form", "letter".;The array of keyed words would look like: ("rude", "deru"), ("dure", "deru"), ("word", "dorw"), ("letter", "eelrtt"), ("from", "fmor"), ("form", "fmor");Going through the array, we find the following anagrams;rude dure;from form


Paper#70003 | Written in 18-Jul-2015

Price : $27