I need to write a program that implements this algorithm.

create a hash table.
for each word in words.txt
sort the letters in word and use that as a key
enter the(key, word) pair into the hash table
prompt the user for a string
while the string s not empty
look up the string in the hash table and print all words that use its letters
prompt the user for a string

for example
string: treat
results:
tater
treat

So the code should be like my lookup version only missing the saving of anagram file.

your lookup version?

My second code snippet.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.