3 ms·
Two-way searching is the norm for substring matching. Even your libc is probably using it for strstr(). For example, here's musl's implementation: http://git.mu
by pcwalton 12y ago
Two-way searching is the norm for substring matching. Even your libc is probably using it for strstr(). For example, here's musl's implementation: http://git.musl-libc.org/cgit/musl/tree/src/string/strstr.c http://git.musl-libc.org/cgit/musl/tree/src/string/strstr.c