String Searching Flashcards
1
Q
(Brute Force) Best case for when searching for only first match?
A
O(m) where m is the length of the pattern
2
Q
(Brute Force) What is the performance in all other cases (best case when searching for all matches, as well as average and worst cases)?
A
O(mn) where m is the length of the pattern and n is the length of the text