I have to improve the attached algorithm pseudo-code to be faster in search.
Originally, the algorithm should do a search within a given string of 30 letters and to find a predefined words and count at each found word the number of times it appears, if not found the count value should be zero.
Note that: the predefined words are within 3 letters to 6 letter only.
The task is to improve the current one, not to issue a completely new code.
For example, to find the words (red, yellow, blue, boy, girl) within the string (outhredkyehyellowjyewsbbluejhy). so red, blue and yellow will appear once and girl/boy will appear zero times.
Please explain the modification happened in steps, so i understand how the algorithm will work!
I need this in 8-10 hrs