8 ms·
One algorithm I keep coming back to is Aho-Corasick, which locates all occurrences of a set of keywords in a string of text in linear time. (https://github.com/
by ahnick 6y ago
One algorithm I keep coming back to is Aho-Corasick, which locates all occurrences of a set of keywords in a string of text in linear time. (https://github.com/ahnick/ahocorasick https://github.com/ahnick/ahocorasick) It's been useful anytime I needed to locate patterns in a group and I didn't want to be looping back over the group repeatedly.