Size: 870
Comment:
|
Size: 950
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 7: | Line 7: |
An ''ordered word ladder'' is an alphabetically-ordered sequence of words where each word in the sequence differs from its predecessor by: | An ''ordered word ladder'' ('owl') is an alphabetically-ordered sequence of words where each word in the sequence differs from its predecessor by: |
Line 9: | Line 9: |
1. adding or removing one letter, e.g. ''band→brand'', and ''heart→hear'' | 1. adding or removing one letter, e.g. ''heart→hear'', and ''band→brand'' |
Line 20: | Line 20: |
Write such a function. | Write such a function and of course test it. Details of the assignment will follow shortly. |
Contents
Assignment 2: Ordered Word Ladders
An ordered word ladder ('owl') 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. heart→hear, and 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
At the heart of the assignment is a function that compares 2 strings and returns true if the strings satisfy one of the 2 conditions above, and false otherwise. This function could have the signature:
1 bool areOwl(char *, char *)
Write such a function and of course test it.
Details of the assignment will follow shortly.