Wednesday, August 24, 2011

Word Ladders


Word Ladders is Problem 1 of Assignment #2: ADT of the 2011 Spring Quarter CS106B course from Stanford.

The description below is taken from the assignment handout (you can download it here here).

A word ladder is a connection from one word to another formed by changing one letter at
a time with the constraint that at each step the sequence of letters still forms a valid word.
For example, here is a word ladder connecting "code" to "data".

code -> core -> care -> dare -> date -> data

That word ladder, however, is not the shortest possible one. Although the words may be
a little less familiar, the following ladder is one step shorter:

code -> cade -> cate -> date -> data


Here is a screenshot of my solution:


You can download my solution code here.

You can also download a runnable .exe file here.

You can download my solution here.

You can download my code here.

No comments:

Post a Comment