• 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?
MIT 6.00 Intro Computer Science (OCW)
  • Stacey Warren - Expert
Hey! We 've verified this expert answer for you, click below to unlock the details :)
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.
  • chestercat
I got my questions answered at in under 10 minutes. Go to now for free help!
  • 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

Looking for something else?

Not the answer you are looking for? Search for more explanations.