【问题标题】:Explanation to Rabin Karp from CLRSCLRS 对 Rabin Karp 的解释
【发布时间】:2019-08-18 03:42:05
【问题描述】:

我一直在阅读Introduction To Algorithms 的Rabin Karp 算法。除以下内容外,一切都有意义。

In general, with a d-ary alphabet {0, 1, . . ., d - 1}, we choose q so
that dq fits within a computer word

我不明白 computer word 是什么以及在此算法的上下文中拟合 dq within a computer word 的意义是什么。

我在某处读到它与单精度数学有关,但我也不懂single-precision math。

谁能分解这些术语?谢谢。

【问题讨论】:

  • A computer word 是一个模棱两可的术语,它可能表示字节,但也可能表示(我认为这是正确的含义)processor word,它表示处理器字的大小(通常为 32 或 64 位)。单精度通常是指float 类型,而不是双精度,称为double。在第一种情况下,这些术语实际上是特定于硬件的,在第二种情况下,实现和语言相关。

标签: algorithm clrs rabin-karp


【解决方案1】:

word 是您的计算机正在处理的标准“类型”。

实际上,一个字对应于 64 位(旧计算机为 32 位)。

【讨论】:

    猜你喜欢
    • 2017-01-17
    • 2022-08-19
    • 1970-01-01
    • 2022-01-10
    • 1970-01-01
    • 2022-01-18
    • 1970-01-01
    • 2013-12-23
    • 2018-04-09
    相关资源
    最近更新 更多