Differences between revisions 1 and 28 (spanning 27 versions)
Revision 1 as of 2019-07-14 17:11:30
Size: 31
Comment:
Revision 28 as of 2019-07-15 08:54:52
Size: 870
Comment:
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
= Assignment 2 = <<TableOfContents>>

= 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&rarr;born''
 1. adding or removing one letter, e.g. ''band&rarr;brand'', and ''heart&rarr;hear''

The following are examples of word ladders of different length:
 * ''ban&rarr;bar&rarr;boar&rarr;boat&rarr;goat'', length 5
 * ''cab&rarr;can&rarr;cane&rarr;dane&rarr;date&rarr;mate&rarr;mite&rarr;site&rarr;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:
{{{#!cplusplus
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, and heart→hear

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.

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