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

Hello everyone. This questions pertains to problem set 4, question number 4a. We are supposed to write a multi-level decryption algorithm that calls itself recursively and returns a group of tuples that can be used to decode the ciphertext. I am a bit stumped at the moment with the start variable. What does it do, also, what is the correct base case?

OpenStudy (anonymous):

Hi! I just got done with problem set 4. It's a really tough one!! start is used to mark the place where the encrypted text starts. If you've already done problem 3 start is just the first variable in each of the tuples. but inside find_best_shifts_rec, it's really useful for recursion. As for the base case, this is my design RECURSIVE DESIGN: BASE CASES: if all the words in the decoded text are valid return a list with a tuple of the position and shift if there are no valid words in the decoded text return none RECURSIVE CASE: if the recursion doesn't return none return a list with a tuple of the start position and shift joined with the recursion

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!