Thursday 5 March 2015

Week 7

Last week we learned about binary trees and binary search trees.  Binary trees are a special type of tree where each node only has two children, a left value and a right value.  Binary search trees are a special type of binary tree where the left child of the node contains a value that is less than that of the node and the right child of the node contains a value that is greater than the value of the node.  With a tree in this configuration, it is easy and efficient to search for values as the computer does not have to look at all of the nodes, only the ones that are greater than the value being searched for.

I found it easier to implement methods for binary trees and binary search trees than for regular trees because I could assume that each node has only two children and I could directly access each node's left and right values, instead of having only a list of the children on the main node to work with, as is the case with trees. 

My group members and I also began work on assignment 2 this week and managed to write most of the tippy game state as well as a version of minimax that worked with subtract square.  However, we were having trouble with figuring out an efficient way to detect all the possible tippy arrangements on any board size, and thus couldn't test our minimax function with a game of tippy. 

2 comments:

  1. We just started A2 too! Get it, two-too = tu-tu = ballerina.

    ReplyDelete