CS 330: Algorithms: Design & Practice

Homework2: Finding Anagrams
Due: In class on Thursday, February 7, 2008

Presentation By: Natasha Eilbert & Mansi Gupta

Use the solution described in Section 2.8 to find all anagrams in the dictionary file /usr/share/dict/words.

Extra Credit:

You may use the code described or translate the code into another language of your choice.

What to hand in

1. A listing of the anagram classes found. In a file of nearly 12/ million words you are guaranteed to find thousands of anagrams. Please don't print them all. You can choose to do one of the following; (1) print all anagram classes that are words with at least 13 characters in them; OR (2) Print anagram classes that have at least 4 words in them; OR (3) Scan the list of anagrams generated and select the 25 most interesting anagram classes (we will leave it to you to decide what most interesting means).

Notes:

The files (located in ~dkumar/cs330/Homework2/) sign.c and squash.c contain code from the book.

The dictionary file contains over 450,000 words. Use 'wc' to find out. The words listed there may have punctuations and capitalized letters. You will have to remove all punctuations and capital letters prior to looking for anagram classes.

Presentation:

Natasha & Mansi will give a presentation on this exercise in class
on Tuesday, February 5. Your presentation should include a description of
the problem and the overall solution. It should also include all the other
things you had to do in the implementation process (things that were not
addressed in the solution in Section 2.8). You may also want to try and
look for other dictionaries or text files (from Project Gutenberg) to search
for interesting anagrams (when you do this, you may want to restrict yourself
to word sizes larger than 6 letters).


Back to CS330 Materials