How would I go about representing the following image in code? I have a slight understanding of trees and I know how I WOULD evaluate the bottom branch in order to get a value of 1 or 0, but I have no idea how I would pass that value up the tree. At this point I do no have any code for creating the tree.
I don't see how "use foreach" even close to answers my question. I'm not asking for an alternative.
i'm confuse about what you asked, you don't know how to implement the tree structure, how to populate the tree with utility values or how to use minimax to solve the problem?
Hey thanks for the Reply. Sorry about name change, I am OP but didn't see my friends account logged on. I believe I am capable of implementing/populating but am just unsure of how to retrieve the values and "pass up" the values to higher layers like the image displays. I have code from lecture regarding in order, preorder, and post order traversing but I doesn't seem like it would accomplish the task at hand.