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

Hy, I am from Italy, I would like just to know if someone has solved problem set 8? I am having problems to set up the dictionary, without that the algorithm is ok, but with is terrible. May you be so kind to help me? ciao! Mirco

OpenStudy (anonymous):

which dictionary are you having problems with? which problem of problem set 8?

OpenStudy (anonymous):

, Problem 4 of problem set 8 on dynamic programming. Where can I put my code in order to show you?

OpenStudy (anonymous):

dpaste.com that one took me a very long time to figure out

OpenStudy (anonymous):

at least we are in two!!!!! here you will find the code http://dpaste.com/559718/ ciao Mirco

OpenStudy (anonymous):

my dpAdvisorHelper looks pretty much like yours - i can't see any real differences except: - i only kept track of the indices - i split the work, value tuple into two lists - i have an extra return statement, (at line 80 of yours, indented 4 spaces) that returns the 'best' because i only kept track of the indices i had to have a function that would 'calculate' the value of the list of indices so that i could compare the with and without results. i also had to have some extra lines of code in dpAdvisor to make a subject dictionary out of the list of indices that were returned. I guess i can't figure out why mine works and yours doesn't. i've attached mine - if you find the difference between mine and yours please let me know.

OpenStudy (anonymous):

your final results are exceeding the maximum work constraint. your memo's are working - on one test i did, the function was called 200 times and 60 of those times there was something in the memo. -mine had the same result for the same test. so it probably isn't the memoization, somehow yours isn't handling maxwork properly

OpenStudy (anonymous):

I have seen your code, thanks a lot for yuor help have a nice day ciao Mirco

OpenStudy (anonymous):

again, if you find the significant difference between mine and yours please post it here. i would really like to understand what that is. thanks

OpenStudy (anonymous):

ok, I will do it. taking out the memoization part I have seen the code is ok. I do not know why my memoization does not work ! I will keep informed on that , thanks a lot Mirco

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!