Lecture 25

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. CLR: Section 26.1, page 644.

Exercises and review questions


Last modified: 27 Nov 2006