A community for students.

Here's the question you clicked on:

55 members online
  • 0 replying
  • 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.

  • This Question is Closed
  1. anonymous
    • 5 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    http://pastebin.com/h3hsKrNN

  2. anonymous
    • 5 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    if you want to look at my code for Q4, please use the above link

  3. anonymous
    • 5 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    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

  4. anonymous
    • 5 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    srry for double posting.

  5. anonymous
    • 5 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    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.

  6. anonymous
    • 5 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    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.

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

    • Attachments:

Ask your own question

Sign Up
Find more explanations on OpenStudy
Privacy Policy

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
  • 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.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.