A community for students.
Here's the question you clicked on:
 0 viewing
anonymous
 5 years ago
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.
anonymous
 5 years ago
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.

This Question is Closed

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0if you want to look at my code for Q4, please use the above link

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0I 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

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0srry for double posting.

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0thank 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
 5 years ago
Best ResponseYou've already chosen the best response.0Alright, 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.
Ask your own question
Sign UpFind more explanations on OpenStudy
Your question is ready. Sign up for free to start getting answers.
spraguer
(Moderator)
5
→ View Detailed Profile
is replying to Can someone tell me what button the professor is hitting...
23
 Teamwork 19 Teammate
 Problem Solving 19 Hero
 Engagement 19 Mad Hatter
 You have blocked this person.
 ✔ You're a fan Checking fan status...
Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.