On problem 8.3 could someone help me out. When I run this http://dpaste.com/578711/ my computer runs for several minutes, but returns something like: "The time to run greedy is 3.09944152832e-06 and the time to run brute force is 2.14576721191e-06 greedy is 1.44444444444 times faster than brute force" Any ideas? Brute force takes forever to run, while greedy runs really quickly. Not sure where I'm going wrong.
I've never passed an entire function, complete with arguments as an argument into a piece of code, have you tried writing code for greedy time and brute time separately and see if that doesn't do something more logical
Something like this works printSubjects(greedyAdvisor(subjects,2,cmpRatio)). I'll mess with the timing aspect later. You don't know if there has been any discussion on 8.4. I'm struggling quite a bit with it.
well your not passing "greedyAdvisor(subjects,2,cmpRatio)" as the argument, your passing what that function returns, the dictionary list, not the program itself
You're right. You don't still have the code to 8.4 do you? The links for a previously discussion about it have expired.
I was having trouble with the memoization component. It wasn't behaving the way I expected it to. I'm going to mess with it for a while longer, will post again if there is something more specific. Thanks for reposting the code.
Join our real-time social learning platform and learn together with your friends!