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

I'm working on problem set 4 (specifically the find_best_shifts and find_best_shifts_rec functions) and there are no solutions to these supplied with the course. They are driving me crazy, and I can't figure out how to solve these two functions. 1) Has anyone successfully done these, or does anyone know where solutions can be found? 2) Are these merely different ways of structuring the same function (one recursive, one not) or are they genuinely different? It seems like they expect the recursive function to be used *inside of* the non-recursive function find_best_shifts

OpenStudy (anonymous):

> 1) I couldn't find out them, and confused also. Maybe it's some kind of mistakes but, I took it as a MIT style. > 2) I thought that find_best_shifts is a function which call find_best_shifts_rec with simple parameters (without parameter: start). the parameter start is required for getting best_shift for each tuple in each recursion, but is not needed for getting the list of tuple, finally. And, I attach my solution. Though it doesn't work perfectly (I'm leaving work to tune up find_best_shifts_rec and decrypt_fable), I hope it will contribute to your study slightly. If you have any advice for my code, please tell me.

OpenStudy (anonymous):

I greatly appreciate your help and the attachment of your file - I found these parts of the assignment to be lacking in clear instruction, so it really made it difficult to figure out what to do. In the fast, there have been times when they left out solutions to parts of their problems, but it had never been an issue until now.

OpenStudy (harsimran_hs4):

http://openstudy.com/study#/updates/50ca830fe4b09c557144eb9f this thread involves conversation and parts of code with test cases and little explanations i had written for this problem....... maybe this helps you

OpenStudy (anonymous):

Thank god, I'll definitely start looking this code over after I go procure some coffee. Briefly reading into it, I was somewhat relaxed after seeing that it usually took between 8 and 10 minutes for the code to complete... when it seemed like Python had crashed on me before after writing my code, I had simply assumed that there was a grand, spectacular error that I had unwittingly introduced, and being unable to figure out what it was, I erased all my code and started over from scratch. Three times. Let's hope today is the last!

OpenStudy (harsimran_hs4):

@jwgilrea this code is mostly self explanatory in nature but still if you have some problems i have one which has some comments to help understand better...... if you are struck somewhere please feel free to ask......

OpenStudy (anonymous):

I definitely will - I plan to start in about half an hour.

OpenStudy (harsimran_hs4):

cool !!! and let me tell you this problem set requires time, patience and quite much analytical thinking......so do it with cool and calm mind ALL THE BEST!!!

OpenStudy (anonymous):

I have perfected the find_best_shifts_rec function, and it is attached. It does not use the find_best_shifts function whatsoever, and I'm still unsure why we even have to use that one. Give this a look! It works wonderfully =)

OpenStudy (anonymous):

hi. I have checked your code. it seem to contain good idea. it means that you build the conditional expression, which make it branch off whether to go recursion or to conclude, with list of unreal words. this idea ensure the perfect output, on condition that the analysis per words are perfect. (if not, it should be closed loop, I think) I'll try imitating your idea and make it better. 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!