So I have a homework assignment where I'm supposed to find out the total number of comparisons (both successful and unsuccessful) the will be made by using the KMP sting matching algorithm when searching for the pattern AAAAAB in a text of 1100 A's.

I have tried constructing my next-j table, which I have to be: 000001 so far. Is this correct? But I am pretty much stuck from there.

Can someone help me/give me hints as to how I can determine how to check how many comparisons, please?

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.