全部书籍

专业

应用 关于 Coach 登录 开始阅读

书籍暂未推出简体中文版——当前显示英文版。

Computer Science · 术语表

什么是 Bad-character rule?

Definition 25.3 University Computer Science — Year 2 · 第 25 章 — Text Algorithms and Compression

Compare PP with the text at shift ss from the right, and let jj be the position of the first difference, with c=T[s+j]c = T[s + j] the bad character. Let λ(c)\lambda(c) be the last position of cc in PP, or −1-1 if cc does not occur in PP. The bad-character rule moves to the shift s+max⁡(1,j−λ(c))s + \max(1, j - \lambda(c)).

The bad-character rule. The pattern River is compared from its right end; the text’s - differs from r and occurs nowhere in the pattern, so no shift that puts a letter of the pattern under it can match, and the pattern jumps past it.
The bad-character rule. The pattern River is compared from its right end; the text’s - differs from r and occurs nowhere in the pattern, so no shift that puts a letter of the pattern under it can match, and the pattern jumps past it.
在原文中阅读 →