Tuesday, 7 April 2015

Week 8: Impressions of week 7

Week 7 is assignment 2 week. Me and my partner have spent hours working on the assignment and made significant progress however we reached a standstill when confronted with minimax. We had a lot of trouble grasping the concepts behind it. After a lot of drawing and brainstorming we were able to picture how it carries out its commands through recursion. It takes a GameState, looks at all possible moves that can be made from that GameState, applies those moves to the current GameState and then returns the new GameStates that resulted from those moves. Now it just needed to do this until it reaches the end game.

Now at this point we were feeling pretty confident, however now came the tougher part of implementing the method. We tried many things but no matter what we did we would either get an infinite recursion or the incorrect output. We had a lot of trouble trying to figure out the base case, we spent a good part of the week working on Minimax however we weren't able to figure it out just yet so we decided to let it go for now and come back to it a little later.

In this weeks lecture we covered Binary Expression Trees. These are trees where parent nodes are arithmetic operators (+,-,* and /) and the leaves of the trees were data values. We learned how to evaluate them as well. Using recursion, the base case is if the tree is just a leaf, in that case we would just return the value of the node. If it is a normal tree, then you visit the left node of the parent to get the first value, then you visit the parent node to get the operator and then you visit the right node.

Another concept related to Trees we covered were Binary Search Trees(BST). BST's are a tree data structure where the values of the nodes are sorted. This is where the left node of the tree has a value lower than the parent and the right node of the tree has a value greater than the parent.

Overall i found the concepts generally interesting. It showed us the many uses of Abstract Data Structures (ADT's) which i originally thought were useless. However after Danny showed us actual applications i felt it was a lot more interesting.

No comments:

Post a Comment