Sunday 29 March 2015

Reflecting on Trees and Binary Trees

In an earlier post, I wrote that I preferred working with binary trees and binary search trees than with trees, because I could make assumptions about the number of children of each node, rather than dealing with a tree with a random number or arrangement of children per node.

Although my view hasn't really changed, after finishing Assignment 3, I have a better understanding of how trees work and how to implement functions that use them.  Even though I still prefer binary trees, I feel much more comfortable now working with trees than I did when I wrote the earlier post.   The grow function in Assignment 3 especially helped my understanding of trees because it required the construction of a tree from scratch.  Similar to when I wrote my first recursive function, writing the grow function with my group members allowed me to explore the construction of trees which made it easier to implement the remaining functions.

I decided to ask my group members what they thought of binary trees vs. trees.  One preferred binary trees because of the assumptions you can make when accessing the items in the tree, while the other preferred working with trees because they were more versatile as you are not limited in the branching factor of the tree. 

No comments:

Post a Comment