原书出处
Introduction to Algorithms, Fourth Edition
32 第32章 字符串匹配
iven pattern P[1:m], the prefix function for P is the function π : {1, 2, …, m} → {0, 1, …
, m –} such that π[q] = max{k : k < q and P[:k] ⊐ P[:q]}. That is, π[q] is the length of the longest prefix of P that is a proper suffix of P[:q]. Here is the complete prefix function π for the pattern ababaca: Figure 32.9 The prefix function π. (a) The pattern P = ababaca aligns with a text T so that the first q = 5 characters
match. Matching characters, in blue, are connected by blue lines. (b) Knowing these parti
原书定位详情
来源:a19c7933-4eda-4176-aebd-30fe7e1ad292
正文位置:extracted/Introduction to Algorithms, Fourth Edition/_epub-src/OEBPS/chapter032.xhtml
EPUB SHA-256:ec7ced04bb875b93983816aef7a667855a4b71c5cf53b63406b9439c74e27aea