What is the function for the KMP Failure Algorithm?

166 Views Asked by At

What is the proper functions that tell us the KMP failure table?

I have looked at a couple but they are very confusing. I am getting a bit confused with the suffixes and the prefixes and how to match them ?

I believe we start with -1 and 0 but I can't seem to understand the rest of the table.

1

There are 1 best solutions below

2
On

You can look at the aho-corasick algorithm and the failure function is computed with a breadth-first-traversal of the trie. You walk each level and each children first with a queue.