I understand the algorithm of pattern matching with a Text T of length n and a Pattern P of length m is linear using the witness table algorithm.
I also know how to construct the witness table in m^2 time but there is an algorithm of O(m) for constructing the table that I don’t understand.
Please help.
maybe you meant this Part I Part II – Correctness
By Amihood Amir
Professor of Computer Science.
(This data is not mine).