Computer Science, asked by timjo6666, 1 day ago

For the given text=ababcdacccdabdc find the pattern=abdc using KMP AND RABIN KARP APPROACH.​

Answers

Answered by saravananmaya1
1

Answer:

When you want to search for multiple patterns, typically the correct choice is to use Aho-Corasick, which is somewhat a generalization of KMP. Now in your case you are only searching for 3 patterns so it may be the case that KMP is not that much slower(at most three times), but this is the general approach.

Rabin-Karp is easier to implement if we assume that a collision will never happen, but if the problem you have is a typical string searching KMP will be more stable no matter what input you have. However, Rabin-Karp has many other applications, where KMP is not an option.

Explanation:

was this answer helpful?

add this as brainly list

Similar questions