For this week, we did a string searching program using an algorithm an check how efficient it is in terms of time.
The algorithm used was Knuth-Morris-Pratt which consists in comparing to the list of words with the word you enter.
*KMP algorithm searches for occurrences of a "word"
Wwithin a main "text string"
Sby employing the observation that when a mismatch occurs, the word itself embodies sufficient information to determine where the next match could begin, thus bypassing re-examination of previously matched characters. (esto dice la wiki :P)
This is the code that performs to verify the comparison: