CSCI 3333.3 Data Structures
Spring 2013
Homework #3

Due: February 13, 2013 (Wednesday)

Write a program (Anagram.java preferred; or Anagram.cpp for C++, etc) to accept a word and print out all anagrams of the word. Your program should use the dictionary words.txt, and run like below:

...\hw>java Anagram meat
The word meat has 3 anagrams: mate, tame, team.

...\hw>java Anagram dog
The word dog has 1 anagram: god.

...\hw>java Anagram april
The word april has no anagram.

Turn in:

(1) An algorithm of a function Anagram that takes a word and a dictionary file name as input and output the list of anagrams of the word.

(2) Your program. Your TA should be able to run your program as "java Anagram tea". If you are not using Java, discuss it with the instructor.

To submit your homework, email your algorithm (<<lastname>>_h3_algorithm.txt or .docx) and your program to the TA. Also include a test run for the words: a, on, beat, meet, loop, ample, drawer, reward and long.