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

Hey, i am attaching my code for PS3 problem 1. i am struggling a bit with recursion so would appreciate any feedback. http://codepad.org/PB5EqcOq function checkP1() just compares results for test cases

OpenStudy (anonymous):

Your code looks really good.

OpenStudy (anonymous):

problem 2 iterative method: http://codepad.org/SlYNqb23

OpenStudy (anonymous):

your recursive function does not allow for overlap - the instructions said to count the number of 'instances' of the key in the target string. http://codepad.org/IFQ7oe55 in that second example the answer should have been 5

OpenStudy (anonymous):

good spot, i replaced +len(key) with +1

OpenStudy (anonymous):

http://codepad.org/IM1yGVmb this is the code for problem 4. would love to see alternative implementations from other people. thanks

OpenStudy (anonymous):

here's my substringmatchexact http://codepad.org/TAS57ZTP and prob 4 http://codepad.org/q3TslsV7 we get different answers for the tests

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!