Initial Pattern Matching Algorithm

  1. read the text and the pattern

  2. position <- 1

  3. repeat until position is too large

  4.      if pattern occurs at position in text then

  5.          write position

  6.       position <- position + 1 (end until loop)

  7. stop

Here we have used a very high level pseudocode to outline our first pass at an algorithm.

Many details have purposefully been omitted.

The flexibility and power of expressing algorithms in pseudocode is emphasized.


CS1104 Main Page
Last Updated 01/05/2000
© L.Heath, 2000