开发者

How do they search inside a string

开发者 https://www.devze.com 2023-01-19 05:44 出处:网络
What is the most efficient way to do this? There must be some better me开发者_如何学Cthod other than brute force.Depends on length of string, size of alphabet and whether repeated searching: Knuth-Mor

What is the most efficient way to do this? There must be some better me开发者_如何学Cthod other than brute force.


Depends on length of string, size of alphabet and whether repeated searching: Knuth-Morris-Pratt, Rabin-Karp, etc.

See String searching algorithm

Knuth-Morris-Pratt algorithm

Rabin-Karp algorithm

0

精彩评论

暂无评论...
验证码 换一张
取 消