I just did ps3a and I created the iterative function. It works but if anyone has any suggestions on how to improve it and clean it up, please let me know. http://dpaste.com/hold/694021/

At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.

Get our expert's

answer on brainly

SEE EXPERT ANSWER

Get your free account and access expert answers to this and thousands of other questions.

A community for students.

I just did ps3a and I created the iterative function. It works but if anyone has any suggestions on how to improve it and clean it up, please let me know. http://dpaste.com/hold/694021/

MIT 6.00 Intro Computer Science (OCW)
See more answers at brainly.com
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.

Get this expert

answer on brainly

SEE EXPERT ANSWER

Get your free account and access expert answers to this and thousands of other questions

http://dpaste.com/hold/694122/
Ok! This is what I got for ps3a. I´m not sure if I understood correctly what it is that it asked for, since it was way too easy, in comparison to the last assignments, to get to it. def countSubStringMatch(target, key): x = target y = key z = 0 ctr = 0 while find(x,y, z) != -1: if find(x,y,z) == z: ctr += 1 z += 1 print ctr Can anyone please enlighten me on what it is that needs to be done so that I can get my butt kicked like I´m supposed to?
Oh! And while I´m at it, here´s my answer to PS3b: def SubStringMatchExact(target, key): x = target y = key z = 0 while find(x,y, z) != -1: if find(x,y,z) == z: print z z += 1 Again... I´m pretty sure I´m not doing what they´re asking of me. Can anyone help?

Not the answer you are looking for?

Search for more explanations.

Ask your own question

Other answers:

EFarias: your implementations give the right results, so it"s ok. Don't worry about the difficulty, the maths will come back soon ! Just a few notes: 1. You don't have to rename the parameters. Just use target and key in the function. 2. For substringMatchExact (but I guess it makes sense for the other functions too), you should return a value, not print it. 3. Your code is not very efficient, since in the while loop you are searching a first time for the key from pos z, if you find it, you continue to search it until the position where key is found is equal to z, incrementing z by 1 each time. You could do better by setting z to the right position.
what is your code for the recursive part of this same question
http://dpaste.com/hold/692393/
http://dpaste.com/693400/

Not the answer you are looking for?

Search for more explanations.

Ask your own question