Ask your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW) 8 Online
OpenStudy (anonymous):

Need some hints for Problem Set 3 Problem 4. I'm not quite sure where to start. How do I decide on which character of key will be omitted from the search? If I have to check all possible omissions, how's that done? The functions from problem 2 and 3 depended on inputting the beginning and end of a string missing a particular character; they didn't dynamically take a key and break it down.

OpenStudy (anonymous):

Hi mtoyama, you would use the functions subStringMatchExact, and subStringMatchOneSub to construct your solution to problem 4. Within subStringMatchOneSub, there is code to dynamically break the key down. (e.g. key1=key[:miss] and key2=key[miss+1:]). The instruction said to use functions from problem 2 and 3, not just the ones that you wrote. In this case they were referring to the function subStringMatchOneSub that they provided. Problem 4 can be rephrase to find all the indexes generated by subStringMatchOneSub that's not in indexes generated by subStringMatchExact

OpenStudy (anonymous):

Whoops. Maybe I should've downloaded the supporting files. Thought I could get away without it - I'll grab them before I go to tackle P4. Thanks!

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!