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

I can't get through assign. 3 in the recursive manner. Any hints?

OpenStudy (anonymous):

can u tell the question or send link to it?

OpenStudy (anonymous):

There are assignments in: http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-00-introduction-to-computer-science-and-programming-fall-2008/assignments/ No 3 is called 'matching strings...' There is a request to prepare a python code to find the string inside the longer string in a recursive manner. I did the iterative one but make up the other one. Is there any hint?

OpenStudy (anonymous):

i wouldn't tell the solution. but a hint decide a base case(i.e where finally 'find' function returns -1) put base case in if statement and in else statement call that function again but with string truncated from the part where it has already counted. Think again How many arguments do u need to pass?

OpenStudy (anonymous):

Thanks to your hint I managed to find the answer! 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!