could someone help me writing an algorithm for this. i dont even know where to begin.
Two (or more) words are anagrams if and only if the letters in one can be rearranged to form the other.
For example, the words canter, nectar, recant and trance are all anagrams; they each consist of the same
letters, just in a different order. For this program, you'll write a program that reads a list of words; then
produce a list of how many anagrams each word has, and the largest list of words that are anagrams of
each other.
this is an example our professor gave in class.
>>> ================================ RESTART ================================
>>>
Name of input file? shortwordlist.txt
There were 5 words with 0 anagrams.
There were 4 words with 1 anagrams.
There were 6 words with 2 anagrams.
There were 4 words with 3 anagrams.
The highest anagram count found was 3
The following words have 3 anagrams:
cater
crate
react
trace
>>>
This post has been edited by macosxnerd101: 17 March 2013 - 03:47 PM
Reason for edit:: Renamed title to be more descriptive

New Topic/Question
Reply



MultiQuote









|