Saturday 28 March 2015

Revisiting Trees

Building up on my post called 'Trees and Branches', I realize that the use of trees in in this course is more frequent than I thought it would be. When at first we were just learning the basic concepts of trees and recursion, I never really imagined that those concepts could be used so extensively in places such as our assignments where we come up with game states and strategies. Every game played for our assignments can be drawn out in full, with every possible move listed, as a tree. Looking at the games in such a way makes it so easy to recursively go through each possible game states to do such things as find the longest path a game could take to finish or to see how many possible outcomes of a game would cause a specific player to win. This is what we have to do(at least for part B) in our last assignment of the course. The idea of trees remains the same but over the course of the semester we've started using trees and recursion as basic necessity. The concepts that I found confusing before, those of arity(the number of children), height(the maximum length path plus 1, I always forget the 1), etc. have become increasingly clear to me  through their usage in labs and assignments. Assignment 3 even has a function, branching_stats, that requires us to recursively calculate the different branching factors in a tree of a game and all that didn't make sense to me before makes sense now.
Which reminds me, assignment 3 is nearly done, one more week to go, woohoo! The finish line's right around the corner y'all!

No comments:

Post a Comment