Differences between revisions 3 and 25 (spanning 22 versions)
Revision 3 as of 2019-07-14 17:36:31
Size: 611
Comment:
Revision 25 as of 2019-07-15 08:49:56
Size: 827
Comment:
Deletions are marked like this. Additions are marked like this.
Line 5: Line 5:
= Assignment 2: Word Ladder = = Assignment 2: Ordered Word Ladders =
Line 7: Line 7:
A ''word ladder'' is a sequence of words
 * which are in alphabetic order
 *
each word in the sequence differs from its predecessor by
  * changing one letter, e.g. ''born→barn''
  * adding or removing one letter, e.g. ''band→brand''
An ''ordered word ladder'' is an alphabetically-ordered sequence of words where each word in the sequence differs from its predecessor by:
 1. changing one letter, e.g. ''barn→born''
 1. adding or removing one letter, e.g. ''band→brand''
Line 14: Line 12:
 * ''big→bit→bat→boat'', length 4
 * ''cold→cord→word→ward→warm'', length 5
 * ''line→fine→five→dive→live→like→lake→take→bake→cake→fake''
 * ''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 1 (i.e. ''true'') if the strings satisfy one of the 2 conditions above, and false otherwise. This function will have signature {{{bool areOwl(char *, char *)}}}. Write such a function.

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:

  1. changing one letter, e.g. barn→born

  2. 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

At the heart of the assignment is a function that compares 2 strings and returns 1 (i.e. true) if the strings satisfy one of the 2 conditions above, and false otherwise. This function will have signature bool areOwl(char *, char *). Write such a function.

Assignment2 (last edited 2019-07-31 22:35:13 by AlbertNymeyer)