On 15.06.2012 23:03, bearophile wrote:
A lazy Knuth-Morris-Pratt that works on a Input Range:
http://ideone.com/dUs5B

Do you have suggestions for improvements of the code? Maybe do I have to
turn it into a Forward Range if the first range is a Forward one? Is
something similar to this useful for Phobos?


Yes, definitely just decouple table preparation and searching range itself. It's common to use KMP and its ilk to do a lot of series of searches for the same needle.

Bye and thank you,
bearophile


--
Dmitry Olshansky

Reply via email to