I'm working on problem set 9 and am having trouble figuring out the brute force algorithm: how do you do this? I guess I kind of understand how to do it if I know how many data inputs there are, but that involves a number of loops equal to the amount of data. Can someone explain how to do it more conceptually, or give me a good place to start? Thanks!
it is probably easiest to implement it as a recursive procedure. you need to check all of the possible subsets. it might be best to have a small dictionary with only around 15 subjects. If you make it recursive, you don't need to know in advance how big the dataset is. in the 2011 class did the prof make and walk through the binary decision tree? You need to write a program that mimics that. At every node the decision to take or not take elicits a recursion. or maybe it is ... at every node there is a recursion - one that takes an item and one that doesn't. for mine the base case was no more items to check (end of the list).
Thanks for the help!
Join our real-time social learning platform and learn together with your friends!