Computer science is about much more than programming. Some themes: o recognizing commonalities among many problems and finding a general solution o knowledge of general strategies and recognizing that a problem can be solved using one of them o analyzing and comparing alternative solutions for efficiency o Today, we will start thinking about algorithms and complexity Program is an algorithm written in a language the computer understands ===Developing the algorithm start at the left of the string see if the pattern matches there if it does, save the position go to the second char of text, see if the pattern matches there If it does save it. do that for the rest of text ===== for the characters in Text: for index in range(....): for p_index in range(0,len(pattern)): compare pattern[p_index] == text[index + p_index] our example: len(text) is 10 len(pattern) is 5 remember, numbering starts at 0 text = ctaca atc pattern is att len(text) is 8 positions are 0 through 7 the last three are 5,6,7 0 through len(text) - len(pattern) range(0,len(text) - len(pattern) + 1)