Type your question here I\'m hoping someone can help me write a program in c++ t
ID: 3531630 • Letter: T
Question
Type your question here I'm hoping someone can help me write a program in c++ that creates a frequency list of words in a passage. The passage is from standard input and a it should generate in standard output a list of disinct words from the passage togethor with the number of times the word occurs. All characters should be converted to lower case and if the word ends in a punctuation symbol, remove it. Use a binary tree, sorted on the words to hold the words and their counts. If a word is seen again, increment the counts.
Explanation / Answer
Step 1: Build an index with a key of the sorted characters in each word in the wordlist and with the value being the the word.
Step 2: For each anagram you want to find, sort the characters in your anagram word, and then match against the index to retrieve all words from index with matching sorted key.
the code is as follows
Step 1: Build an index with a key of the sorted characters in each word in the wordlist and with the value being the the word.
act - cat act - act dgo - dog ... aeeilnppp - pineapple .... etc... Step 2: For each anagram you want to find, sort the characters in your anagram word, and then match against the index to retrieve all words from index with matching sorted key.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.