Learning objectives

After this class, you should be able to:

  1. Given a pattern and a text, show each step of the Knuth-Morris-Pratt algorithm for pattern matching.
  2. Give reasons to justify the correctness of the Knuth-Morris-Pratt algorithm for pattern matching, and derive its time complexity.

Reading assignment

  1. CLR: Section 32.4.
  2. Final Review

Exercises and review questions


Last modified: 4 Aug 2004