首页 > 试题广场 >

试说明如何扩展Rabin-Karp算法用于处理以下问题: &

[问答题]
试说明如何扩展Rabin-Karp算法用于处理以下问题:  在一个nXn的二维字符数组中搜索一个给定的mXm的模式。(该模式可以在水平方向和垂直方向移动,但是不可以旋转。)
Calculate the hashes in each column just like the Rabin-Karp in one-dimension, then treat the hashes in each row as the characters and hashing again.
发表于 2020-01-04 15:41:29 回复(0)