Learning objectives
After this class, you should be able to:
- Define the string matching problem and the following terms: text, pattern, valid shift, invalid shift, empty string, concatenation of strings, prefix, suffix.
- Given a pattern and a text, apply the naive string matching algorithm to determine all occurrences of the pattern in the text.
- Prove simple properties of suffixes and prefixes, such as lemma 32.1, including new ones not discussed in class.
- Give reasons to justify the correctness of the naive algorithm, and derive its time complexities.
- Given a new algorithm for string matching, prove its correctness and derive its time complexity, or prove that it is incorrect.
- Given an algorithm for string matching, give examples to demonstrate worst-case and best-case time complexities.
Reading assignment
- CLR: Chapter 32, up to (and including) section 32.1.
Exercises and review questions
- Questions on current lecture's material
- Give the prefix of length 3 and the suffix of length 3 for the string abcdabcdab.
- CLR excercise 32.1-1.
- CLR excercise 32.1-2.
- CLR excercise 32.1-3.
- Questions on next lecture's material
- None
Last modified: 30 Jul 2004