← 返回卡片

原书出处

Introduction to Algorithms, Fourth Edition

32 第32章 字符串匹配

Fourth edition · 核验版本的摘录快照 · 导入于 2026-10-23T08:18:08.764Z

e powers of a larger number (such as powers of 256 for the extended ASCII character set)?

Then the values of p and ts might be too large to work with in constant time. Fortunately, this problem can be solved, as Figure 32.4 shows: compute p and the ts values modulo a suitable modulus q. You can compute p modulo q in Θ(m) time and all the ts values modulo q in Θ(n − m + 1) time. With |∑| = 10, if you choose the modulus q as a prime such that 10q just fits within one computer word, then you can perform all the necessary computations with single-precision

arithmetic. In general, with a d-ary alphabet {0, 1, …, d – 1}, choose q so that dq fits

此预览只包含定位所需的摘录和上下文。

原书定位详情

来源:a19c7933-4eda-4176-aebd-30fe7e1ad292

正文位置:extracted/Introduction to Algorithms, Fourth Edition/_epub-src/OEBPS/chapter032.xhtml

EPUB SHA-256:ec7ced04bb875b93983816aef7a667855a4b71c5cf53b63406b9439c74e27aea