-
For each of the following cases find the number of comparisons to find the
index (first occurrence) of the pattern P in the text T.
a) P =cat, T = bcbcbcbc
b) P= bbb T= aabbaabbaabbaabbb
c) P= xxx T= xyxxyxxxyxxxyxxxxy
-
What is the complexity of the brute force string-matching algorithm in the best case.
-
Write a procedure to count the number of the time the word 'the' appears in a given
text .
-
Find the output of The FailureFunction for the pattern P = aabbaababbabaa
-
Can we find the occurrence of the pattern P in the text T by computing FailureFunction for the string PT which is the concatenation of the strings P and T. If so, then write an algorithm for that and what is the running time of your algorithm?
-
Give best case inputs (both pattern and text) for KMP string matching algorithm.