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

problem set 3a, I can't come up with a way to finish off my recursive part of my function. So far I have: def countSubStringMatchRecursive(target,key): if (find(target,key) < 0): return 0; return 1 + countSubStringMatchRecursive(target[find(target, key)],key); i feel like i should replace the 1 in the return statement with the function.

OpenStudy (anonymous):

Think about what your trying to do. You found the key in the target. Now what you want to do is to renew the search, in the substring(which is the string starting from where you find the key until the end of the target string) also keep in mind that you need to keep track of every instance you find the key string. If you have problems with that, or again with the code. post again and we'll help you.

OpenStudy (carlsmith):

I always find it easier to draw the recursion if I'm struggling with visualising the process. A quick block diagram, with each nested block indented, like regular Python blocks, works for most stuff in practice. [ start ] [ next ] [ next ] Just scribble it on paper and have a look at it. You'll find you've got it sussed before you've drawn very much of it. Don't try and go on like Michaelangelo.

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!