Size: 1706
Comment:
|
Size: 1680
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 15: | Line 15: |
/* | |
Line 16: | Line 17: |
Your assignment is to write a program that computes the longest word ladder(s) that can be built from a set of words given on stdin. The output of your program is the maximum length of all the word ladders that can be built from the input words, together with all the word ladders that have this length. | Your assignment is to write a program that computes the longest word ladder(s) that can be built from a set of words given on stdin. The output of your program is the maximum length ordered word ladder, together with all the ordered word ladders that have this length. |
Line 37: | Line 38: |
*/ |
Contents
Assignment 2: Ordered Word Ladders
An ordered word ladder is an alphabetically-ordered sequence of words where each word in the sequence differs from its predecessor by:
changing one letter, e.g. barn→born
adding or removing one letter, e.g. band→brand
The following are examples of word ladders of different length:
ban→bar→boar→boat→goat, length 5
cab→can→cane→dane→date→mate→mite→site→size, length 9