CSC 344 - Algorithms and Complexity

Dr R. M. Siegfried

Assignment #7 - Deriving the Finite State Machines for the Knuth-Morris-Pratt Algorithm

Due Friday, March 24, 2017

We saw in Lecture #7 how to construct the tables (and diagrams) for the Finite State Machines (FSMs) that we use in the KMP (Knuth-Morris Pratt) algorithm.

Construct the FSMs for the following strings:

  1. 12311243 (the alphabet is 12345)
  2. aabbaba (the alphabet is abc)
  3. 00111010 (the alphabet is 01)
  4. [Back to the Assignments Page]