anonymous
  • anonymous
Can someone please give me any hints to Q4 in ps8?? I am horribly stuck. I understand how the recursive helper function used in Q3 works and am using a slightly modified version of it. I do not know what to memoize. Right now I am memoizing the counter/index (i) and subsetWork values.
MIT 6.00 Intro Computer Science (OCW)
schrodinger
  • schrodinger
I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!
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

anonymous
  • anonymous
http://pastebin.com/h3hsKrNN
anonymous
  • anonymous
if you want to look at my code for Q4, please use the above link
anonymous
  • anonymous
I will have alook at your code. This was one of th emost tasking problems I've seen in this course so far. Here's how I solved it. (I got clues from looking at other people's soluiton). http://pastebin.com/QQRmkQvS

Looking for something else?

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

More answers

anonymous
  • anonymous
srry for double posting.
anonymous
  • anonymous
thank you so much mercutio22......this problem was certainly killing me. I am wondering if the guys at ocw should consider changing their implementation of bruteforceadvisorhelper function to make life easier for students as it is really very tough to understand that implementation and convert it into one that uses dynamic programming. But maybe my approach was wrong and I should have tried to use my own implementation variant in dpadvisorhelper rather than copying the one provided in bruteforceadvisorhelper. Thanks once again. Now that I know that this problem CAN be solved I will try coding my own implementation variant with dynamic programming.
anonymous
  • anonymous
Alright, glad to know that was helpful. Tell me if there's anything in my code you don't understand. The trick is creating not only a memo to remember the best value achievable but also another memo to remember the item combo that achieves it.

Looking for something else?

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