知识卡片
拉宾卡普把等长片段映成数
把字母表字符视作d进制数字,长度m的模式及文本窗口都可映成一个数;数值相同等价于窗口字符逐位相同。这为用窗口数值比较替代直接逐字比较铺路,但大数成本需另行处理。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 第32章 字符串匹配 · 查看原书依据
, 9}, so that each character is a decimal digit. (In the general case, you can assume that each character is a digit in radix-d notation, so that it has a numerical value in the range 0 to d – 1, where d = |∑|.) You can then view a string of k consecutive characters as representing a length-k decimal number. For example, the character string 31415
参考来源
- 位置:《算法导论(第4版)》第32章《字符串匹配》(OEBPS/chapter032.xhtml,文本字符[10000,15000))。
- 结论依据:原文定义字符串匹配、前后缀或相应算法的比较规则;相关图式已核对。
- 原始内容:For expository purposes, let’s assume that ∑ = { 0 , 1 , 2 , …, 9 }, so that each character is a decimal digit. (In the general case, you can assume that each character is a digit in radix- d notation, so that it has a numerical value in the range 0 to d – 1, where d = |∑|.) You can then view a string of k consecutive characters as representing a length- k decimal number. For example, the character string 31415