Assignment #6: Word Changing

A word can be changed to another word by a 1-character substitution. Assume that a dictionary of 5-letter words exists. Write a program that reads the dictionary and then repeatedly prompts the user for to words A and B. The program determines if a word A can be transformed to a word B by a series of 1-character substitutions, and if so, outputs the corresponding sequence of words (using the fewest number of substitutions). As an example, bleed converts to blood by the sequence bleed, blend, blond, blood.

A dictionary of five letter words will be provided. The dictionary is relatively small, having less than 5,000 words, so a quadratic algorithm is acceptable. A sub-quadratic algorithm will get you extra points.

What To Submit

Submit all your source code and the results of running the program on pairs of words that I will specify.

Due Date

This program is due on Tuesday, November 30.