Any string-matching algorithm requires at least linear time and a constant number of local storage locations. We design and analyze an algorithm which realizes both asymptotic bounds simultaneously. This can be viewed as completely eliminating the need for the tabulated "failure function" in the linear-time algorithm of Knuth, Morris, and Pratt. It makes possible a completely general implementation as a Fortran subroutine or even as a six-head finite automaton. © 1983.
Galil, Z., & Seiferas, J. (1983). Time-space-optimal string matching. Journal of Computer and System Sciences, 26(3), 280–294. https://doi.org/10.1016/0022-0000(83)90002-8